wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python if statement part3

Total questions: 11

Worksheet time: 10mins

Name
Class
Date
1.

What statement will go into the label?

a)

John is getting ice cream

b)

John is getting apple juice

c)

John is getting baby formula

d)

John is getting nothing

2.

The ‘else’ statement is optional in Python

a)

TRUE

b)

FALSE

3.

There can be an else statement without an if statement

a)

TRUE

b)

FALSE

4.

How many "else" statements can you pair with a single "if" statement

a)

1

b)

<10

c)

<20

d)

As many as is needed.

5.

Which of these is used in Python to add a third, fourth, etc outcome to a scenario?

a)

elif

b)

else if

c)

iff

d)

elsa

6.
This operator means that one value is the same as the other value
a)
==
b)
!=
c)
>
d)
<
7.

What will get printed as a result of the code?

a)

Packers

b)

Packers are #1

c)

Cowboys are #1

d)

Error

8.

belowFreezing = temperature < 32

What is belowFreezing?

a)

variable that is an integer

b)

variable that is an boolean

c)

variable that is a string

d)

boolean expression

e)

arithmetic expression

9.

What is printed?

a)

BRRR its cold out there!

b)

Do you want to make a snowman?

c)

Nothing

10.

majorGPA=3.0

overallGA=3.2

What value of numCredits will set the compound boolean expression to False?

a)

119

b)

120

c)

121

11.

word = "apples"

What is printed?

a)

in range

b)

out of range