- Home
- All MCQs
All MCQs with Answers · Page 678
43,842 multiple choice questions from every subject, newest first. Switch on practice mode to hide the answers and test yourself.
Where are compiled .pyc files stored in Python?
What is the output of print(pow(6, 2, 10)) in Python?
print(pow(6, 2, 10))
What does the gc module control in Python?
What is the output of print(6 & 7) in Python?
print(6 & 7)
What is the time complexity of Python's built-in sort?
What is the output of print({1: 'a', True: 'b'}) in Python?
print({1: 'a', True: 'b'})
What does Optional[int] mean in a type hint in Python?
What does json.dumps(obj, indent=2) do in Python?
What is the output of print([x for x in [1, 2, 3] if x > 1]) in Python?
print([x for x in [1, 2, 3] if x > 1])
What does time.time() return in Python?
What is the output of the following Python code snippet?
from itertools import cycle, islice
print(list(islice(cycle([1, 2]), 4)))
print(list(islice(cycle([1, 2]), 4)))
What is the output of print(dict.fromkeys(['a', 'b'])) in Python?
print(dict.fromkeys(['a', 'b']))
What is the output of print(len(max(['a', 'abc', 'ab'], key=len))) in Python?
print(len(max(['a', 'abc', 'ab'], key=len)))
What is the output of the following Python code snippet?
fs = [lambda: i for i in range(3)]
print([f() for f in fs])
print([f() for f in fs])
What is the output of the following Python code snippet?
from collections import deque
d = deque([1, 2])
d.appendleft(0)
print(d)
d = deque([1, 2])
d.appendleft(0)
print(d)
Which Python implementation uses a just-in-time (JIT) compiler for speed?
Which class provides a high-level interface for thread and process pools in Python?
Which built-in module lets you work with SQLite databases in Python?
What is the output of the following Python code snippet?
from datetime import date
print((date(2024, 1, 8) - date(2024, 1, 1)).days)
print((date(2024, 1, 8) - date(2024, 1, 1)).days)
What is the difference between bytes and bytearray in Python?
What is a race condition in Python?
What is the output of the following Python code snippet?
from itertools import accumulate
print(list(accumulate([1, 2, 3])))
print(list(accumulate([1, 2, 3])))