Loading...
Loading...
Test your knowledge of control flow
1. What does if age = 18: do?
2. What is the output?
x = 7
if x > 10:
print("Big")
elif x > 5:
print("Medium")
else:
print("Small")3. Which condition is True?
4. What does "Py" in "Python" return?
5. What's wrong with this code?
if score >= 60:
print("Passing")
if score >= 90:
print("Excellent")6. What does not (10 > 5) return?
7. Which is the correct way to check if a variable a is None?
8. What is the output of not ("apple" in ["banana", "cherry"])?
9. If a = [1, 2] and b = [1, 2], what is a == b?
10. What does this output?
temp = -5
if temp <= 0:
print("Freezing")
elif temp <= 15:
print("Cold")
elif temp <= 25:
print("Warm")
else:
print("Hot")