Data Science MCQs · Page 16
1,613 multiple choice questions with answers across 28 topics.
What is the default recursion limit in CPython?
What is encapsulation in Python?
What algorithm does Python use to compute MRO?
What is the output of print(int('1010', 2)) in Python?
print(int('1010', 2))
What exception is raised when calling a method on None, e.g. None.upper() in Python?
What is the output of print({1, 2}.issubset({1, 2, 3})) in Python?
print({1, 2}.issubset({1, 2, 3}))
What is the time complexity of accessing a list element by index in Python?
What is the difference between remove() and discard() on a set in Python?
How does CPython primarily manage memory?
What happens if you instantiate a class with an unimplemented abstractmethod in Python?
What is the output of the following Python code snippet?
def f(a, b): return a + b
print(f(a=1, 2))
print(f(a=1, 2))
What is the output of print(list(range(2, 8, 2))) in Python?
print(list(range(2, 8, 2)))
What is the output of print(list({'a': 1, 'b': 2}.items())) in Python?
print(list({'a': 1, 'b': 2}.items()))
Which decorator defines a method that receives neither self nor cls in Python?
What does the is operator check in Python?
Why is the with statement recommended when working with files in Python?
What is the output of print(len('Python')) in Python?
print(len('Python'))
What is the purpose of __init__.py in a directory in Python?
What does the continue statement do in Python?
What is the output of print([1, 2, 3][::-1]) in Python?
print([1, 2, 3][::-1])
What is the result of 7 % 3 in Python?
What is the recommended way to avoid the mutable default argument pitfall in Python?
What is the output of print(sorted([2, 3, 1], reverse=True)) in Python?
print(sorted([2, 3, 1], reverse=True))