- Home
- All MCQs
All MCQs with Answers · Page 743
45,334 multiple choice questions from every subject, newest first. Switch on practice mode to hide the answers and test yourself.
What does the underscore _ hold in the interactive interpreter in Python?
Why are Python strings immutable?
What is the output of the following Python code snippet?
from dataclasses import dataclass, field
@dataclass
class C:
items: list = field(default_factory=list)
print(C().items)
@dataclass
class C:
items: list = field(default_factory=list)
print(C().items)
Which DataFrame method shows the first five rows by default in Python?
What does it mean that Python's sort is stable?
What does timeit do in Python?
Which threading primitive prevents simultaneous access to shared data in Python?
What does the -m flag do in python -m pip install requests?
What is the output of the following Python code snippet?
import math
print(math.pi)
print(math.pi)
What is the output of the following Python code snippet?
def g():
for i in range(3):
yield i
print(list(g()))
for i in range(3):
yield i
print(list(g()))
What is the output of print([1, 2, 3][5:]) in Python?
print([1, 2, 3][5:])
What is the output of print(sorted({'a': 3, 'b': 1, 'c': 2}.values())) in Python?
print(sorted({'a': 3, 'b': 1, 'c': 2}.values()))
Which module creates temporary files and directories in Python?
What is the output of print('ab'.removesuffix('b')) in Python?
print('ab'.removesuffix('b'))
What does df.dropna() do in Python?
What is the output of print(7.5 // 2) in Python?
print(7.5 // 2)
Which module offers thread-based concurrency in Python?
What does mypy do in Python?
What is the output of the following Python code snippet?
from functools import wraps
def d(f):
@wraps(f)
def wrapper(): return f()
return wrapper
@d
def hello(): pass
print(hello.__name__)
def d(f):
@wraps(f)
def wrapper(): return f()
return wrapper
@d
def hello(): pass
print(hello.__name__)
What does python -c 'print(1+1)' do?
Which tool is commonly used to manage multiple dependency sets and lock files in modern Python projects?
What is the output of the following Python code snippet?
d = {'a': 1, 'b': 2}
print(d.popitem())
print(d.popitem())