wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

🔦 Formative Assessment 2: Flow Controls

Total questions: 10

Worksheet time: 2mins

Name
Class
Date
1.
What is the syntax for a while loop in Python?
a)
for i in range()
b)
while i in range()
c)
while condition:
d)
none of the choices
2.
How many times will a while loop execute if the condition is initially false?
a)
0
b)
1
c)
infinite
d)
none of the choices
3.

Which statement allows the program to execute a block of code repeatedly if you have sets of data already?

a)
if-else
b)
while loop
c)
for loop
d)
none of the choices
4.
What is the syntax for a for loop in Python?
a)
for condition:
b)
while i in range()
c)
while condition:
d)
none of the choices
5.
How many times will a for loop execute if the condition is initially false?
a)
0
b)
1
c)
infinite
d)
none of the choices
6.
What is the syntax for if-else in Python?
a)
for condition:
b)
if condition:
c)
while condition:
d)
none of the choices
7.
What is the purpose of an if-else statement?
a)
To execute a block of code repeatedly as long as a certain condition is met.
b)
To execute a block of code repeatedly for a specific number of times.
c)
To make a decision based on a condition.
d)
none of the choices
8.
What is the syntax for an if-elif-else statement in Python?
a)
if condition: elif: else:
b)
if condition: else: elif:
c)
if condition: elif condition: else:
d)
none of the choices
9.
How many times will an if-else statement execute?
a)
0
b)
1
c)
infinite
d)
none of the choices
10.
Which statement allows the program to execute a block of code repeatedly as long as a certain condition is met?
a)
if-else
b)
while loop
c)
for loop
d)
none of the choices