Data Science MCQs · Page 11
1,613 multiple choice questions with answers across 28 topics.
What is the output of the following Python code snippet?
sq = lambda x: x * x
print(sq(5))
print(sq(5))
What is the output of print(True + True) in Python?
print(True + True)
Which module in the standard library is used for regular expressions in Python?
Which module serialises Python objects to a binary format?
What does the os module provide in Python?
Which built-in returns a function's documentation string in Python?
What is the output of the following Python code snippet?
try:
1 / 0
except ZeroDivisionError:
print('Cannot divide by zero')
1 / 0
except ZeroDivisionError:
print('Cannot divide by zero')
What is the maximum value of an int in Python 3?
What is the output of print('42'.zfill(5)) in Python?
print('42'.zfill(5))
Which mode opens a file for appending text in Python?
What is the output of the following Python code snippet?
x = 3
print('big' if x > 5 else 'small')
print('big' if x > 5 else 'small')
What is the output of print(f'{3.14159:.2f}') in Python?
print(f'{3.14159:.2f}')
What is the output of the following Python code snippet?
def f(a, b):
return a * b
print(f(b=5, a=3))
return a * b
print(f(b=5, a=3))
What is the output of print([1, 2] * 2) in Python?
print([1, 2] * 2)
Which Python version introduced f-strings?
What exception is raised when the recursion limit is exceeded in Python?
What does the @dataclass decorator generate automatically in Python?
What is the difference between __str__ and __repr__ in Python?
Which statement about tuples and lists is correct in Python?
Which method splits a string into lines in Python?
What does the Zen of Python state is better than complex?
Who created the Python programming language?
What is the output of print([10, 20, 30, 40][1:3]) in Python?
print([10, 20, 30, 40][1:3])
What is the output of print(all([])) in Python?
print(all([]))