Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSP Python Review

Total questions: 25

Worksheet time: 19mins

Name
Class
Date
1.
The second part of if, that is executed when the condition is False
a)
if
b)
else
c)
for
d)
input
2.
Data type that can only be True or False
a)
int
b)
string
c)
bool
d)
float
3.
Which function casts a number to a string?
a)
str()
b)
int()
c)
parseInt()
d)
convert
4.
Python identifies blocks of code by
a)
BEGIN and END keywords
b)
{ and }
c)
aligning up the starts of lines (indentation)
d)
guessing
5.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
6.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
7.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
8.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
9.
What will the output be from the following code?
print(3*4)
a)
34
b)
7
c)
12
d)
3*4
10.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
11.
What will the output be from the following code?
print(9/3)
a)
3
b)
3.0
c)
9/3
d)
SyntaxError
12.
What will the output be from the following code?
print(9/3*2+4-5)
a)
19
b)
5.0
c)
0.5
d)
5
13.
What will the output be from the following code?
print("Hello" + "world!")
a)
Hello world!
b)
Helloworld!
c)
SyntaxError
d)
"Hello" "world!"
14.
What will the output be from the following code?
print("Hello" + 2 + "world")
a)
Hello 2 world
b)
Hello2world
c)
TypeError
d)
HelloHelloworld
15.
Which Python command is used to output information to the screen?
a)
read
b)
output
c)
print
d)
display
16.
Which of these would work as a piece of code?
a)
IF answer == "Yes":
b)
if answer == "Yes"
c)
if answer == "Yes":
d)
if answer = "yes":
17.
Used to create exponents
a)
**
b)
"""
c)
%
d)
#
18.
Returns the remainder from division
a)
modulo (mod)
b)
exponents
c)
boolean
d)
variables
19.
a line of text that Python won't try to run as code
a)
comment
b)
modulo (mod)
c)
variable
d)
boolean
20.
symbol used for modulo (mod)
a)
%
b)
&
c)
#
d)
**
21.
Used to make comments
a)
#
b)
%
c)
**
d)
()
22.
The correct way to write a variable in Python?
a)
my_variable = 10
b)
my variable = 10
c)
my_variable is 10
d)
my_variable: 10
23.
What does the following code do?
name = input("What is your name?")  
a)
says hello 
b)
asks for the user's DOB
c)
Asks for the user's name and stores it in a variable 
d)
Checks information 
24.
This operator means that one value is the same as the other value
a)
==
b)
!=
c)
>
d)
<
25.
What's the result of the following operation?
7 % 5
a)
1
b)
2
c)
1.4
d)
12%