- Home
- MCQs by exam
- Python Interview Standard Library
- Data Science
Python Interview Standard Library MCQs – Data Science · Page 2
44 multiple choice questions typical of the Python Interview Standard Library exam, with answers and explanations. Switch on practice mode to test yourself first.
What does re.compile() provide in Python?
Which class in the csv module reads rows as dictionaries in Python?
What is the output of the following Python code snippet?
import re
print(re.findall(r'[cb]at', 'cat bat rat'))
print(re.findall(r'[cb]at', 'cat bat rat'))
What is the correct order of logging levels from lowest to highest severity in Python?
Which module is used for secure random tokens and passwords in Python?
Which module provides the fast heap-based priority queue in Python?
What Python value does JSON null become after json.loads?
What is the output of the following Python code snippet?
from datetime import date
print(date(2024, 3, 5).strftime('%m/%d/%y'))
print(date(2024, 3, 5).strftime('%m/%d/%y'))
What is the output of the following Python code snippet?
from datetime import datetime
print(datetime.strptime('2024-03-05', '%Y-%m-%d').year)
print(datetime.strptime('2024-03-05', '%Y-%m-%d').year)
What does sys.path contain in Python?
Which module should be used to handle time zones in modern Python (3.9+)?
Which argument avoids blank lines when writing CSV files on Windows in Python?
What is the output of print(b'hi'.decode()) in Python?
print(b'hi'.decode())
Which pytest feature lets you reuse setup code across tests in Python?
What is the output of the following Python code snippet?
import math
print(math.pi)
print(math.pi)