wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Assessment Year 8

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.
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
2.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
3.
What will the output be from the following code?
Print("Hello world!")
a)
NameError
b)
Hello world!
c)
"Hello world"
d)
Print(Hello world!)
4.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
5.
What will the output be from the following code?
print(9/3)
a)
3
b)
3.0
c)
9/3
d)
SyntaxError
6.
What will the output be from the following code?
print("Hello" + "world" + "today")
a)
Helloworldtoday
b)
Hello world today
c)
"Hello" "world" "today"
d)
SyntaxError
7.
What will the output be from the following code?
print("Hello world!" * 2)
a)
TypeError
b)
Hello world world!
c)
Hello world!Hello world!
d)
Hello world! * 2
8.
What will the output be from the following code?
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
9.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
10.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
11.
A location in memory used to store data that can be changed.
a)
Constant
b)
Value
c)
Variable
d)
Iteration
12.
Which function takes a users input
a)
print()
b)
int()
c)
input()
d)
def
13.
print("12"*3)
What would this print?
a)
36
b)
121212
c)
24
d)
12*3
14.
Which is the most appropriate data type for: "13th December"
a)
Float
b)
Boolean
c)
Integer
d)
String
15.

Why do we learn Python?

a)

It's a really big snake

b)

It's the name of a very funny comedy show

c)

It's simple and easy to learn

d)

It's so rare that no one else knows it

16.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
17.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
18.
for x in range(0,9):
     print(x)
How many numbers would this print?
a)
7
b)
8
c)
9
d)
10
19.
Which of these can never change?
a)
constant
b)
variable
c)
integer
d)
life
20.
Which of these is used for selection?
a)
if
b)
while
c)
for
d)
do
21.
Which of these is used for iteration?
a)
for
b)
if
c)
int
d)
print
22.
When would I use '=='?
a)
Checking if two values are equal
b)
Making a value equal to another
c)
Checking if a value is not equal to another value
d)
Check if a value exists or not
23.
x = int(input("Enter a Number"))
print(X)
Why won't this work?
a)
Brackets are in the wrong place
b)
Print should have a capital letter
c)
It should have two equals
d)
both x variables should be lower case
24.
Which is the most appropriate data type for: True
a)
Float
b)
Boolean
c)
Integer
d)
String
25.

What are the key constructs of Python/programming languages

a)

Sequence

b)

Selection

c)

Iteration

d)

Opening Google Classroom and completing the starter activity

26.

A WHILE loop is what kind of loop?

a)

A conditional loop

b)

A summer holiday loop

c)

A counting loop

d)

A fast loop

27.

What does 'Sequence' mean?

a)

Doing things/code executing in order

b)

Repeating lines of code again and again and again...

c)

Binary code

d)

Making decisions with IF ELIF and ELSE statements

28.

What does the '#' do in Python?

a)

Tag celebrities

b)

Alert you that it is a Friday

c)

Debug your code

d)

Add comments

29.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
30.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
31.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
32.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
33.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name  = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
34.

To make the turtle move forward, which command is used?

a)

turtle.penup()

b)

turtle.forward()

c)

turtle.left()

d)

turtle.backward()

35.

When creating a rectangle with the turtle, what angle is needed when turning?

a)

120

b)

180

c)

45

d)

90

36.

In order to move the turtle 120 forward without drawing on the screen, which order is correct?

a)

turtle.forward(120)

turtle.penup()

turtle.pendown()

b)

turtle.pendown()

turtle.forward(120)

turtle.penup()

c)

turtle.penup()

turtle.forward(120)

turtle.pendown()

37.

To fill a shape with the colour red, which command is correct?

a)

turtle.fillcolor('Red')

b)

turtle.fillcolour('Red')

c)

turtle.fillcolor("Red")

d)

turtle.fillcolour("Red")

38.

What is the extension on a Python file name?

a)

.py

b)

.xsl

c)

.ppt

d)

.docx

39.

How do you write a program in Python?

a)

Using Word

b)

Using IDLE

c)

Using Powerpoint

d)

Using Excel

40.

What is the window called where you write your code?

a)

Editor

b)

Shell

41.

What happens if you call your python progam "turtle"

a)

your program crashes because you have spelt it wrong

b)

your program crashes because it stops the import turtle line from working

c)

your program crashes because it should have been saved as turtle.turtle

d)

your program runs fine

42.

Which of these commands would successfully create a turtle named Alice

a)

Alice = turtle.pen()

b)

Alice = Turtle.pen()

c)

Alice = Turtle.Pen()

d)

Alice = turtle.Pen()

43.

How do you tell python you want to use the turtle library

a)

turtle import

b)

import turtle

c)

from libraries import turtle

d)

from turtle import libraries

44.

What is the keyword needed to repeat code (iterate) in Python?

a)

for

b)

if

c)

input

d)

print

45.

What does turn(90) do?

a)

Turns right 90 degrees

b)

Turns left 90 degrees

c)

Moves forward 90

d)

Does nothing as 'turn' is not a turtle instruction

46.

Look at this code, how many times will it loop?

a)

50

b)

90

c)

0

d)

4

47.

What shape will this create?

a)

Triangle

b)

Rectangle

c)

Hexagon

d)

Will look like the turtle is climbing stairs

48.

What does t.forward(300) do?

a)

Moves in the direction it is facing 300 steps

b)

Moves down the screen 300 steps

c)

Moves up the screen 300 steps

49.

To stop the turtle drawing you need to use which of the following commands?

a)

penup:

b)

pen_up

c)

penup()

d)

penup():

50.

In order to move the turtle 120 forward without drawing on the screen, which order is correct?

a)

forward(120)

penup()

pendown()

b)

pendown()

forward(120)

penup()

c)

penup()

forward(120)

pendown()