- Home
- All MCQs
All MCQs with Answers · Page 753
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 the following Python code snippet?
import re
print(re.findall(r'\d+', 'ab12cd345'))
print(re.findall(r'\d+', 'ab12cd345'))
What is the output of the following Python code snippet?
m = [[0] * 2] * 2
m[0][0] = 1
print(m)
m[0][0] = 1
print(m)
What does functools.lru_cache do in Python?
Which collections class provides default values for missing keys in Python?
What is the output of the following Python code snippet?
d = {'a': 1, 'b': 2}
d.update({'b': 3, 'c': 4})
print(d)
d.update({'b': 3, 'c': 4})
print(d)
What is the output of print(all([1, 2, 3])) in Python?
print(all([1, 2, 3]))
What is the output of print(list(range(5, 0, -1))) in Python?
print(list(range(5, 0, -1)))
What is the output of print([x for x in range(5) if x % 2 == 0]) in Python?
print([x for x in range(5) if x % 2 == 0])
What is the output of print([3, 1, 2].sort()) in Python?
print([3, 1, 2].sort())
What is the output of the following Python code snippet?
d = {'a': 1, 'b': 2}
print({k: v for k, v in d.items() if v
What is the output of print({1, 2} ^ {2, 3}) in Python?
print({1, 2} ^ {2, 3})
What is the output of the following Python code snippet?
d = {'a': 1, 'b': 2}
print(d.pop('a'))
print(d.pop('a'))
What does super() do in Python?
Which of these can NOT be used as a dictionary key in Python?
What is the output of print('1234'.isdigit()) in Python?
print('1234'.isdigit())