wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Turtle Python Quiz 1

Total questions: 27

Worksheet time: 15mins

Name
Class
Date
1.
Look at this code, how many times will it loop?
a)
50
b)
90
c)
0
d)
4
2.
Look at this code, what shape will it make?
a)
Square
b)
Triangle
c)
Rectangle
d)
Hexagon 
3.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
4.

How do we create variables in python?

a)

Var ==1

b)

Var != 1

c)

Var = 1

d)

Var ;= 1

5.

How do we print a statement in python?

a)

print_(x)

b)

print.x

c)

print.(x)

d)

print(x)

6.

What will be the output for the following program

x = 'apple'

print(x)

a)

X

b)

x

c)

print(X)

d)

apple

7.

The correct syntax for creating a turtle is

a)

Turtle = turtle

b)

house = tutle.Turtle()

c)

house = turtle-Turtle()

d)

house = turtle.Turtle()

8.

What settings can be applied to Python turtle graphics? Tick all those that apply

a)

Position

b)

Colour

c)

Orientation

d)

Sound

9.

There is an error on this piece of code, what is the correct statement?

a)

screen.bgcolor("lightblue")

b)

screen.bgcolor="lightblue")

c)

screen.bgcolour("lightblue")

d)

screen.bgcolor=lightblue()

10.

There is an error on this piece of code, what is wrong?

a)

Nothing

b)

No start_fill() set

c)

No colour set in the end fill e.g. end_fill("blue")

d)

No colour set in the start fill e.g. start_fill("blue")

11.

There is an error on this piece of code, how should it be written?

a)

There is no error

b)

turtle.right(90)

c)

turtle.drawcircle(10)

d)

import.turtle

12.
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
13.

What is the correct syntax for the for loop in python turtle?

a)

for i in range()

b)

for i in range()::

c)

for i in range

d)

for i in range():

14.

Comments are:

a)

Written for humans to read and understand

b)

Only needed when a program is over 50 lines

c)

Commands performed by the computer

d)

Always blue when Python recognizes them

15.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
16.
In python the ' STRING data type' can be defined as...?
a)
holds alphanumeric text
b)
hold whole numbers
c)
holds numbers with a decimal point
d)
holds either a true or false value
17.
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’
18.
In python the ' FLOAT data type' can be defined as...?
a)
holds alphanumerical data
b)

holds whole numbers

c)

holds a decimal point in a number

d)
hold either true or false
19.
In python the ' BOOLEAN data type' can be defined as...?
a)
holds alphanumerical data
b)
holds whole numbers
c)
holds a number with a decimal point
d)
holds either true or false
20.
To stop the turtle drawing you need to use which of the following commands?
a)
penup:
b)
pen_up( )
c)
penup( )
d)
penup( ):
21.
Stores a piece of data, and gives it a specific name
a)
variable
b)
whitespace
c)
interpreter
d)
modulus
22.
Surrounds multi-line comments
a)
"""
b)
**
c)
#
d)
%
23.
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
24.

Which of these will give us a completely random colour?

a)

turtle.color(randint(0,255),randint(0,255),randint(0,255))

b)

turtle.color(randint(0,255),0,0)

c)

turtle.color(randint(0,10),randint(250,255),randint(0,300))

d)

randint(0,255),randint(0,255),randint(0,255)

25.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
26.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
27.

True or False:

There are no symbols which can be used in a variable name.

a)

True

b)

False