- Home
- All MCQs
All MCQs with Answers · Page 742
45,334 multiple choice questions from every subject, newest first. Switch on practice mode to hide the answers and test yourself.
What is the output of print((1, 2, 3) < (1, 3)) in Python?
print((1, 2, 3)
What is bytecode in Python?
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 does generator.close() do in Python?
What happens to hashing when you define __eq__ without __hash__ in Python?
What module can profile where a Python program spends time?
What is the result of np.array([1, 2, 3]) * 2 in Python?
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 the send() method of a generator do in Python?
What does sys.path contain in Python?
What is the output of print(len({'a': 1, 'b': 2, 'c': 3})) in Python?
print(len({'a': 1, 'b': 2, 'c': 3}))
What is the output of the following Python code snippet?
class A:
__slots__ = ('x',)
a = A()
try:
a.y = 10
except AttributeError:
print('AttributeError')
__slots__ = ('x',)
a = A()
try:
a.y = 10
except AttributeError:
print('AttributeError')
Which tool lints Python code for errors and style issues?
What is the output of print({1, 2}.isdisjoint({3, 4})) in Python?
print({1, 2}.isdisjoint({3, 4}))
What does the global statement affect in Python?
Which module should be used to handle time zones in modern Python (3.9+)?
What is the output of print(sum(c in 'aeiou' for c in 'education')) in Python?
print(sum(c in 'aeiou' for c in 'education'))
Why should SQL queries use parameter placeholders instead of string formatting in Python?
Which Python version introduced the walrus operator :=?
What is the output of print({1, 2} <= {1, 2, 3}) in Python?
print({1, 2}
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 print({1, True, 2}) in Python?
print({1, True, 2})