ifs Quiz
By Mickey Arnold
starstarstarstarstarstarstarstarstarstar
Last updated 10 months ago
13 Questions
1 point
1
Question 1
1.
What is the output?
bob = 805if bob > 800: bob = 0else: bob = bob + 25print(bob)
What is the output?
bob = 805
if bob > 800:
bob = 0
else:
bob = bob + 25
print(bob)
1 point
1
Question 2
2.
what is the output?
ann = 250if ann > 100: ann = ann – 25elif ann < 100: ann = ann + 25print(ann)
what is the output?
ann = 250
if ann > 100:
ann = ann – 25
elif ann < 100:
ann = ann + 25
print(ann)
1 point
1
Question 3
3.
What is the output?
fred = 700if fred < 200 or fred > 600: print("APLUS")else: print("COMP SCI!")
What is the output?
fred = 700
if fred < 200 or fred > 600:
print("APLUS")
else:
print("COMP SCI!")
1 point
1
Question 4
4.
What is the output?
volume = 45if volume > 75: print("Too loud!")elif volume < 40: print("Too quiet!")print("Playing music")
What is the output?
volume = 45
if volume > 75:
print("Too loud!")
elif volume < 40:
print("Too quiet!")
print("Playing music")
1 point
1
Question 5
5.
What is the output?page = 178if page < 50: print("Beginning of ")elif page < 200: if page < 100: print("First half of") else: print("Second half of")else: print("End of ")print("book")
What is the output?
page = 178
if page < 50:
print("Beginning of ")
elif page < 200:
if page < 100:
print("First half of")
else:
print("Second half of")
else:
print("End of ")
print("book")
6 points
6
Question 6
6.
Relational operators
Relational operators
arrow_right_alt | Determines if two values are equal | |
arrow_right_alt | Determines if two values are not equal | |
arrow_right_alt | Determines if a value is greater than another | |
arrow_right_alt | Determines if a value is less than another | |
arrow_right_alt | Determines if a value is greater than or equal to another | |
arrow_right_alt | Determines if a value is less than or equal to another |
3 points
3
Question 7
7.
Logical operators
Logical operators
arrow_right_alt | Either x or y must be true | |
arrow_right_alt | Both x and y must be true | |
arrow_right_alt | If x is true, it becomes false If x is false, it becomes true |
1 point
1
Question 8
8.
What would be the output?
8 > 10 or 1< 2
What would be the output?
8 > 10 or 1< 2
1 point
1
Question 9
9.
What would be the output?
8 > 10 and 1< 2
What would be the output?
8 > 10 and 1< 2
1 point
1
Question 10
10.
What would be the output?
(12.5 > 10 or 8 > 10) or 1< 2
What would be the output?
(12.5 > 10 or 8 > 10) or 1< 2
1 point
1
Question 11
11.
What would be the output?
(12.5 > 10 and 8 > 10) or 1< 2
What would be the output?
(12.5 > 10 and 8 > 10) or 1< 2
1 point
1
Question 12
12.
What would be the output?
8 > 10 and (1< 2 and 4 > 2)
What would be the output?
8 > 10 and (1< 2 and 4 > 2)
1 point
1
Question 13
13.
What would be the output?
8+3 > 10 and (1< 2 and (10/5 + 2 > 2))
What would be the output?
8+3 > 10 and (1< 2 and (10/5 + 2 > 2))