Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Control Statements

Total questions: 25

Worksheet time: 15mins

Name
Class
Date
1.
If you are checking the equality of two values, you should use: 
a)
=
b)
==
2.
How would you check for inequality?
a)
=!
b)
!=
3.
To check if a value is more than another value, you should use: 
a)
<
b)
>
4.

What is the modulus value for 2%2 ?

a)

0

b)

1

c)

2

d)

3

5.

What is the modulus value for 4%2 ?

a)

0

b)

1

c)

2

d)

3

6.

What is the modulus value for 6%3 ?

a)

0

b)

1

c)

2

d)

3

7.

What is the modulus value for 90%3?

a)

0

b)

1

c)

2

d)

3

8.

How do you write a Less than or equal to Relational operator

a)

<=

b)

=<

c)

>=

d)

=>

9.

What is the output of this code?
spam = 7
if spam > 5:
           print("five")
if spam > 8:
             print("eight")

a)

eight

b)

five

c)

nothing

10.

Is python an interpreter or compiler programming language?

a)

Compiler

b)

Interpreter

11.

What output will the console show, if 15 and 30 are entered by the user?

a)

Syntax error

b)

The sum of the two numbers - 45

c)

The concatenation of the two numbers - 1530

d)

Complier error

12.

What result will display in the shell if 15 and 20 is entered by the user?

a)

"num1 + num2"

b)

1520

c)

35

13.

What datatype will the answer be if the user enters 15 and 30?

a)

Integer

b)

String

c)

Boolean

d)

Float

14.
Returns the remainder from division
a)
modulus
b)
exponents
c)
boolean
d)
variables
15.
Stores a piece of data, and gives it a specific name
a)
variable
b)
whitespace
c)
interpreter
d)
modulus
16.
Surrounds multi-line comments
a)
"""
b)
**
c)
#
d)
%
17.
A line of text that Python won't try to run as code
a)
comment
b)
modulus
c)
variable
d)
boolean
18.
Symbol used for modulus
a)
%
b)
&
c)
#
d)
**
19.
Used to make comments
a)
#
b)
%
c)
**
d)
()
20.
The correct way to write a variable in Python?
a)
myVariable = 10
b)
my Variable = 10
c)
myVariable is 10
d)
myVariable: 10
21.
102 = 100
Which of the following is used in Python to calculate ten squared?
a)
10 ** 2
b)
10 * 2
c)
10 % 2
d)
10 ** 10
22.
To solve a problem that requires the user to enter 10 numbers would use what type of iteration?
a)
While loop
b)
For loop
c)
Variable
d)
Selection
23.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
24.
What will the output be from the following code?
print("Hello" + "world!")
a)
Hello world!
b)
Helloworld!
c)
SyntaxError
d)
"Hello" "world!"
25.
Which Python command is used to output information to the screen?
a)
read
b)
output
c)
print
d)
display