Booleans Practice Quiz¶
CS20-FP2 Investigate how control structures affect program flow.
To confirm that you understand the major concepts you’ve seen in Python, try to answer the following questions without opening Python.
Question 1¶
- True
- Great!
- False
- Try again!
boolean-quiz1: What would the following print?:
a = 6
b = 10
print(a == 6)
Question 2¶
- True
- Great!
- False
- Try again!
boolean-quiz2: What would the following print?:
a = 6
b = 10
print( not (b == 6) )
Question 3¶
- True
- Great!
- False
- Try again!
boolean-quiz3: What would the following print?:
a = 6
b = 10
print( a == 10 or b == 10 )
Question 4¶
- True
- Great!
- False
- Try again!
boolean-quiz4: What would the following print?:
a = 6
b = 10
if a == 6 and 10:
print("True")
else:
print("False")
Question 5¶
- True
- Great!
- False
- Try again!
boolean-quiz5: What would the following print?:
a = 6
b = 10
print( not a == 10 and b == 10 )
Question 6¶
- True
- Try again!
- False
- Great!
boolean-quiz6: What would the following print?:
a = 6
b = 10
print( a == 10 or not b == 10 )
Question 7¶
- True
- Great!
- False
- Try again!
boolean-quiz7: What would the following print?:
a = 6
b = 10
print( a == 6 and (not a == 10) )
Question 8¶
- True
- Try again!
- False
- Great!
boolean-quiz8: What would the following print?:
a = 6
b = 10
print( not ( not a == 10 or not b == 10) )