- Home
- MCQs by exam
- Python Interview Advanced
- Data Science
Python Interview Advanced MCQs – Data Science · Page 2
48 multiple choice questions typical of the Python Interview Advanced exam, with answers and explanations. Switch on practice mode to test yourself first.
What is a weak reference in Python?
What is the output of print(list(map(str.lower, ['A', 'B', 'C']))) in Python?
print(list(map(str.lower, ['A', 'B', 'C'])))
What does deque(maxlen=3) do when a fourth item is appended in Python?
What is the output of the following Python code snippet?
d = {'a': 2, 'b': 1}
print({v: k for k, v in d.items()})
print({v: k for k, v in d.items()})
Which module offers a thread-safe FIFO queue in Python?
What is the output of print(list(reversed([3, 2, 1]))) in Python?
print(list(reversed([3, 2, 1])))
What does generator.close() do in Python?
What module can profile where a Python program spends time?
What does the send() method of a generator do in Python?
What is the output of print(len({'a': 1, 'b': 2, 'c': 3})) in Python?
print(len({'a': 1, 'b': 2, 'c': 3}))
Which tool lints Python code for errors and style issues?
What is the output of print({1, 2} <= {1, 2, 3}) in Python?
print({1, 2}
What does it mean that Python's sort is stable?
What does timeit do in Python?
Which threading primitive prevents simultaneous access to shared data in Python?
What is the output of the following Python code snippet?
def g():
for i in range(3):
yield i
print(list(g()))
for i in range(3):
yield i
print(list(g()))
What is the output of print(7.5 // 2) in Python?
print(7.5 // 2)
Which module offers thread-based concurrency in Python?
What does mypy do in Python?
What is the output of the following Python code snippet?
from functools import wraps
def d(f):
@wraps(f)
def wrapper(): return f()
return wrapper
@d
def hello(): pass
print(hello.__name__)
def d(f):
@wraps(f)
def wrapper(): return f()
return wrapper
@d
def hello(): pass
print(hello.__name__)