- Home
- All MCQs
All MCQs with Answers · Page 744
45,334 multiple choice questions from every subject, newest first. Switch on practice mode to hide the answers and test yourself.
What is the output of print(1 << 3) in Python?
print(1
What is the output of the following Python code snippet?
d = {'a': 1, 'b': 2}
try:
for k in d:
d['c'] = 3
except RuntimeError:
print('RuntimeError')
try:
for k in d:
d['c'] = 3
except RuntimeError:
print('RuntimeError')
What does os.environ provide in Python?
What is the output of the following Python code snippet?
class A:
def __init__(self): print('A init')
class B(A):
def __init__(self): print('B init')
B()
def __init__(self): print('A init')
class B(A):
def __init__(self): print('B init')
B()
What does sys.argv contain in Python?
Which module offers object-oriented filesystem paths in Python?
What is the output of the following Python code snippet?
a = [1, 2, 3]
a.remove(2)
print(a)
a.remove(2)
print(a)
What does del a[0] do on a list a in Python?
What is the output of the following Python code snippet?
for i, c in enumerate('ab'):
print(c, i)
print(c, i)
What is the output of print((1, 2, 1, 3, 1).count(1)) in Python?
print((1, 2, 1, 3, 1).count(1))
What is the output of the following Python code snippet?
a = 256; b = 256
x = [1]; y = [1]
print(a is b, x is y)
x = [1]; y = [1]
print(a is b, x is y)
What is the data type of the value True in Python?
Which method reads the entire content of a file as a string in Python?
What does the await keyword do in Python?
What is the output of the following Python code snippet?
a = [1, 2, 3]
a.reverse()
print(a)
a.reverse()
print(a)
What is the output of print((lambda a, b: a * b)(2, 3)) in Python?
print((lambda a, b: a * b)(2, 3))
What is a decorator in Python?
What is the output of print('5' + '5') in Python?
print('5' + '5')
What is the output of print(sum([1, 2, 3])) in Python?
print(sum([1, 2, 3]))
Which module provides exact decimal arithmetic in Python?
What is the output of print(round(3.14159, 2)) in Python?
print(round(3.14159, 2))
What is the output of print({'a': 1, 'b': 2} | {'b': 3}) in Python?
print({'a': 1, 'b': 2} | {'b': 3})