Quiz Answer Key and Fun Facts
1. What is the output of print("5" * 3)?
2. What is the output of print([i for i in range(3)])?
3. What is the output of print(bool("False"))?
4. What does the following snippet output and why?
x = [False] * 3
print(any(x))
5. Which of these statements about Python functions is TRUE?
6. What is the output of this code?
a = [1, 2, 3]
b = a
b.append(4)
print(a)
7. Which of the following is NOT a valid way to create a set in Python?
8. What is the output of this code?
print(bool([0]), bool({}), bool(()))
9. What is the output of the following code?
x = 5
x = x++ + ++x
print(x)
10. What will be the output of the following snippet?
x = [1, 2, 3]
del x[1]
print(x)
Source: Author
Hesting_horts
This quiz was reviewed by FunTrivia editor
WesleyCrusher before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.