- Home
- All MCQs
All MCQs with Answers · Page 688
43,842 multiple choice questions from every subject, newest first. Switch on practice mode to hide the answers and test yourself.
Which collection can be used as a dictionary key in Python?
What is the output of the following Python code snippet?
try:
print('A', end=' ')
except:
print('B', end=' ')
finally:
print('C')
print('A', end=' ')
except:
print('B', end=' ')
finally:
print('C')
What is the output of print(bool('0')) in Python?
print(bool('0'))
What is the output of print(hex(255)) in Python?
print(hex(255))
What is the output of the following Python code snippet?
try:
int('x')
except (TypeError, ValueError):
print('caught')
int('x')
except (TypeError, ValueError):
print('caught')
Which function returns the data type of an object in Python?
What happens when you open an existing file with mode 'w' in Python?
What is the output of print(callable(len)) in Python?
print(callable(len))
What exception does next() raise when an iterator is exhausted in Python?
What does namedtuple from collections provide in Python?
What is the output of print([1, 2] == [1, 2]) in Python?
print([1, 2] == [1, 2])
What is the output of print([1, 2, 2, 3].count(2)) in Python?
print([1, 2, 2, 3].count(2))
Which module provides deepcopy() for copying nested objects in Python?
Which module reads and writes CSV files in Python?
Which function checks whether a class inherits from another in Python?
What is the output of the following Python code snippet?
a = [1, 2, 3]
b = a.copy()
b[0] = 99
print(a, b)
b = a.copy()
b[0] = 99
print(a, b)
What does a bare * in def f(a, *, b) mean in Python?
Which module is best suited for I/O-bound concurrency with async/await in Python?
What is the output of print(5 and 0) in Python?
print(5 and 0)
How can you see a class's MRO in Python?
What is the output of the following Python code snippet?
s = 'hello'
s[0] = 'H'
s[0] = 'H'
What is the output of print(sorted([3, 1, 2], key=lambda x: x)) in Python?
print(sorted([3, 1, 2], key=lambda x: x))
What is the output of print('Python'[::-1]) in Python?
print('Python'[::-1])