wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Year 9 Python Review

Total questions: 19

Worksheet time: 10mins

Name
Class
Date
1.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
2.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
3.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
4.
Python is an example of a....
a)
Text-based programming language
b)
Object orientated programming language
c)
language written in java script
d)
Visual-based programming language
5.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
6.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
7.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
8.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
9.
In python the ' INTEGER data type' can be defined as...?
a)
holds alphanumeric data as text
b)
holds whole numbers
c)
holds numbers with a decimal point
d)
holds either ‘true’ or ‘false’
10.
what is correct code for INTEGER in python?
a)
in
b)
ing
c)
int
11.

What is the output from the following code?

print ("hello world")

a)
Hello World
b)
hello world
c)
print hello world
12.
What output will this code produce?
a)
4
b)
2
c)
3
d)
5
13.

What will the output be from the following code?

print(3+4)

a)

3+4

b)

7

c)

SyntaxError

d)

print(3+4)

14.

What will happen when this code is run and the user types in yes?

a)

It will print the following:

is it raining today?

yes

The code will return:

Better take a brolly

or you will get wet

Enjoy the weather

Is it windy today?

b)

It will print the following:

is it raining today?

yes

The code will return:

Better take a brolly

or you will get wet

Is it windy today?

c)

It will print the following:

is it raining today?

yes

The code will return:

Better take a brolly

or you will get wet

d)

It will print the following:

is it raining today?

yes

The code will return:

Better take a brolly

15.

Where is there an error in this code?

a)

Line 2

No need for white space

b)

Line 3

No need for ==

c)

Line 8

There is no print instruction

d)

Line 3 missing a colon ( : )

16.

What does the operator != on line 3 represent

a)

Is exactly

b)

Is an integer

c)

Is a statement

d)

Is not

17.

Which of the following is the operator used in Python to say less than or equal to

a)

==

b)

<=

c)

>=

d)

<

18.

What does int mean as shown in line 2 and line 4 of the code?

a)

It tells python to remember an input as a variable

b)

It tells python that the user is going to input something

c)

Integral - it tells python to integrate this line of code

d)

Integer - it tells Python that a whole number will be input

19.

This is code to calculate the price of tickets charged to customers. On which line of code is there an error?

a)

Line 4

b)

Line 5

c)

Line 6

d)

Line 8