Data Science MCQs · Page 3
1,613 multiple choice questions with answers across 28 topics.
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])))
Which module runs external commands and captures their output in Python?
Which function is recommended for measuring elapsed time precisely in Python?
What is the output of the following Python code snippet?
try:
[].pop()
except IndexError:
print('IndexError')
[].pop()
except IndexError:
print('IndexError')
What is composition in OOP in Python?
What is the output of the following Python code snippet?
from pathlib import Path
print(Path('file.txt').suffix[1:])
print(Path('file.txt').suffix[1:])
What is a metaclass in Python?
What is the output of print([3, 1].sort() == [1, 3]) in Python?
print([3, 1].sort() == [1, 3])
Which library provides machine learning algorithms such as classification and regression in Python?
What is the output of the following Python code snippet?
class M:
@staticmethod
def mul(a, b): return a * b
print(M.mul(3, 4))
@staticmethod
def mul(a, b): return a * b
print(M.mul(3, 4))
What is the output of the following Python code snippet?
x, y = 'ab'
print(x)
print(x)
What is the naming convention for unittest test methods in Python?
Which module encodes data to Base64 in Python?
Which pandas structure is a one-dimensional labelled array in Python?
Which DataFrame method gives summary statistics of numeric columns in Python?
What does the doctest module do in Python?
What is the output of print(int(False)) in Python?
print(int(False))
What is the output of the following Python code snippet?
from dataclasses import dataclass
@dataclass
class P:
x: int
y: int
print(P(1, 2))
@dataclass
class P:
x: int
y: int
print(P(1, 2))
What is the right way to pause inside a coroutine without blocking the event loop in Python?
Which module performs binary search on a sorted list in Python?
What is the output of the following Python code snippet?
from collections import deque
d = deque([1, 2, 3])
d.rotate(1)
print(d)
d = deque([1, 2, 3])
d.rotate(1)
print(d)