You are on page 1of 4

2/13/23, 6:11 PM Python If Elif Else Statement

NAME : 
CLASS : 
Python If Elif Else Statement
20 Questions DATE  : 

1. The result of this program:


Friday = False
if Friday:
print "Jeans day!"
else:
print "Uniform day"

A Not Friday B Today is Friday

C Uniform day D Jeans day

2. What is the output?

A 7 B spam

C more than 23 D more than 7

3. What is the output?

A stop B syntax error - program doesn't work

C next D nextstop

4. What is the output?

A 357 B 3

C 7 D 37

https://quizizz.com/print/quiz/63ea111c5a36f7001ede961e 1/6
2/13/23, 6:11 PM Python If Elif Else Statement

5. What is the output?

A TrueNIL B TrueNILNIL

C True D NIL

6. What part of an if statement should be indented?

A The statements within it B the first line

C the lines within the brackets D All of it

7. Given the nested if-else below, what will be the value x when the
code is executed successfully.

A 0 B 2

C 3 D 4

8. Given the nested if-else structure below, what will be the value of
x after code execution completes.

A 3 B 0

C 4 D 2

https://quizizz.com/print/quiz/63ea111c5a36f7001ede961e 2/6
2/13/23, 6:11 PM Python If Elif Else Statement

9. What is the output of the following if statement?

A False B True

10. Which is the correct syntax?

A HAS_DOG = tRue B has_dog = Treu

C has_dog = True D has_dog = true

11. An if statement must evaluate to:

A False B True or False

C True D Right or Wrong

12. This operator means that one value is the same as the other value

A < B !=

C == D >

13. What is the result of the code:


team = Cowboys
if team = Cowboys:
print(Dallas is #1)

A Error B Team

C Dallas is #1 D Cowboys

14. What best defines an IF statement in python?

An IF statement checks to see if a


statement is true or false and then does
A Is an embedded string with a variable B
one of two things depending on the
result.

https://quizizz.com/print/quiz/63ea111c5a36f7001ede961e 3/6
2/13/23, 6:11 PM Python If Elif Else Statement

15. I am 71 years old! What will the output be?: IF you are 70 or older, say “You are aged to
perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You
are a spring chicken!”

A "You are a spring chicken!" B "Wow, you are half a century old!"

C “You are aged to perfection!”

16. I am 18 years old! What will the output be?: IF you are 70 or older, say “You are aged to
perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You
are a spring chicken!”

A "You are spring chicken!" B "Wow, you are half a century old!"

C "You are aged to perfection"

17. If else statement

A Gets data from the user B A decision

C A loop controlled by a decision D Outputs a message on the screen

18. What would be the result of 3 ** 3

A 9 B 27

C 6

19.

A Three digit number B Two digit number

C One digit number D More than three digit number

20.

A Year is a leap year B code compiles error

C Year is not a leap year

https://quizizz.com/print/quiz/63ea111c5a36f7001ede961e 4/6

You might also like