Python Quiz

441. What does this code output?

x = [1, 2, 3]
y = x.copy()
print(x is y)
442. Which Python module provides tools for working with iterators?
443. What is the output of:

print(bool([]) or bool('False'))
444. What does the walrus operator `:=` do in Python?
445. Which method is used to convert an object into a JSON string?
446. What will this print?

x = 10
def f():
  global x
  x += 1
f()
print(x)
447. What is the output of:

print((lambda x, y=2: x * y)(3))
448. Which statement best describes a Python generator function?
449. Which of the following will raise a `KeyError`?
450. Which of these is **not** a valid Python data type?

Explore Programming Topics