- Home
- MCQs by exam
- Python Interview Advanced Python
- Data Science
Python Interview Advanced Python MCQs – Data Science · Page 2
41 multiple choice questions typical of the Python Interview Advanced Python exam, with answers and explanations. Switch on practice mode to test yourself first.
What is the output of the following Python code snippet?
def deco(f):
def w():
print('before')
f()
print('after')
return w
@deco
def hi():
print('hi')
hi()
def w():
print('before')
f()
print('after')
return w
@deco
def hi():
print('hi')
hi()
What is the difference between import x and from x import y in Python?
What is the output of print(any([])) in Python?
print(any([]))
Which module provides the @contextmanager decorator in Python?
What is the difference between an iterable and an iterator in Python?
What is a context manager in Python?
How does CPython primarily manage memory?
What is the purpose of __init__.py in a directory in Python?
Which library is most commonly used for tabular data analysis in Python?
What is the difference between shallow copy and deep copy in Python?
What is a virtual environment in Python?
What is the output of the following Python code snippet?
import re
print(re.findall(r'\d+', 'ab12cd345'))
print(re.findall(r'\d+', 'ab12cd345'))
What does functools.lru_cache do in Python?
What is the output of print(all([1, 2, 3])) in Python?
print(all([1, 2, 3]))
What is the output of print([x for x in range(5) if x % 2 == 0]) in Python?
print([x for x in range(5) if x % 2 == 0])