wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Flow Control

Total questions: 8

Worksheet time: 4mins

Name
Class
Date
1.

The program snippet above is syntactically correct

a)

False

b)

True

2.

You should be at least 18 years to vote. What should be the expression in the if statement that will print


can vote.

a)

age >= 18

b)

age = 18

c)

age == 18

3.

What is the output of the program above.

a)

can vote

b)

can drink

c)

can vote can drink

4.

What is the output of the above program

a)

can vote

can drink

b)

can vote

c)

can drink

d)

none of the above

5.

What is the output of the code above

a)

go watch cartoons

b)

can vote

c)

go get a girlfriend/boyfriend

6.

For which value of age, will the output "go drink" get printed

a)

It will never print

b)

17

c)

22

7.

The program above will print

a)

Nothing

b)

tends to drink

c)

tends to chitchat

8.

The code above will print

a)

python

b)

java

c)

None