wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Turtle Quiz

Total questions: 75

Worksheet time: 39mins

Name
Class
Date
1.

What Python Turtle function allows you to change the colour of a shape's borders?

a)

fillcolor

b)

pencolor

c)

linecolor

d)

bordercolor

2.

which is the correct syntax for a function from the option given below?

a)

def myFunction

b)

myFunction()

c)

def myFunction():

d)

def myFunction()

3.

What line of code is necessary to use drawing functions in Python such as fillcolor, forward, left and right?

a)

from turtle import*

b)

start turtle

c)

begin_turtle

d)

import python

4.

Which of the following functions can be used to create a loop? (check all that apply)

a)

for i in range

b)

if

c)

else

d)

while

5.

What would the following code draw?

a)

A triangle pointing up

b)

A triangle pointing to the right

c)

A triangle pointing to the left

d)

A triangle pointing down

6.

What would the following code output?

a)

A green vertical line

b)

A green horizontal line

c)

A green diagonal line

d)

An error message

7.

What would the following code output?

from turtle import*

goto(-100, 0)

a)

A blank screen

b)

A vertical line going from the middle of the screen straight down

c)

A horizontal line going from the middle of the screen to the left

d)

A horizontal line going from the middle of the screen to the right

8.

Which of the following codes would output a circle? (check all that apply)

a)

from turtle import*

for i in range(360):

forward(1)

left(1)

b)

from turtle import*

dot(300)

c)

from turtle import*

circle(300)

d)

from turtle import*

round(300)

9.

What Python Turtle function allows you to change the colour of a shape?

a)

fill_color

b)

fillcolor

c)

shape_fill

d)

shape_color

10.

What functions are used in Python when creating different branches of code that are only run when a certain condition is true or false? (check all that apply)

a)

while

b)

if

c)

elif

d)

else

11.

In turtle, we use widget instead of functions?

a)

Yes

b)

No

c)

I dont know

d)

Maybe

12.

What is the output of the following code:

hello = 100

Print(" I would like to say " + hello)

a)

I would like to say hello

b)

I would like to say 100

c)

Error

d)

I dont know

13.

what function prevents your turtle from drawing on the screen

(a)  

14.

create a function called Hello

(a)  

15.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
16.

What is the output of Name = print('Dave")

a)

dave

b)

"Dave"

c)

Syntax Error

d)

Dave

17.

Which is the Python logo?

a)
b)
c)
d)
18.

x = 5

y = 6

print(x*y)


The code above displays the following:

a)

11

b)

x*y

c)

Syntax Error

d)

30

19.

The output of the program

x = 4

x = "Sally"

print(x)

a)

four

b)

Saly

c)

Sally

20.

Which of the following is not valid variable name in Python?

a)

var11

b)

11var

c)

var_name

d)

_var

21.

Which of the following will give error?

a)

a,b,c=1, 2 , 1.5

b)

a=b=c=1

c)

a,b,c=1

d)

None of the above

22.

Which of the following is a valid variable?

a)

var@

b)

32var

c)

abc_a_c

d)

class

23.

Python only works in Linux and Windows.

a)

True

b)

False

24.

Python is free and open source

a)

True

b)

False

25.

Why python is popular?

a)

Because it is easy to learn and has clear syntax.

b)

Because it is hard to learn and has complex syntax

c)

Because it is derived from Java

d)

Because it is used by Apple

26.

How do you create a variable with the numeric value 5?

a)

x=5

b)

x=5.0

c)

x=int(5)

d)

all of the above

27.

What is the correct syntax to output the type of a variable or object in Python?

a)

print(type(x))

b)

print(typeof(x))

c)

print(type of (x))

d)

print(typeOf(x))

28.

In Python, 'Hello', is the same as "Hello"

a)

True

b)

False

c)

Cant say

d)

both are wrong

29.

Which operator is used to multiply numbers?

a)

X

b)

#

c)

%

d)

*

30.

Which operator can be used to compare two values?

a)

<>

b)

!=

c)

=

d)

==

31.

How do you start writing an if statement in Python?

a)

if x>y :

b)

if (x>y)

c)

if (x>y) then:

d)

if x is >y :

32.

True or False:

phone.number is a good name for a variable.

a)

True

b)

False

33.

True or False:

5.0 is an example of the 'float' datatype.

a)

True

b)

False

34.

In this code, how much does an apple cost?

a)

£1

b)

50p

c)

20p

d)

25p

35.

True or False:

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

a)

True

b)

False

36.

What is an integer?

a)

A number with a decimal point.

b)

A whole number.

c)

An array of characters.

d)

A single character.

37.

What function converts the data in a variable into a 'float'?

a)

int()

b)

flt()

c)

bool()

d)

float()

38.

Variable names can start with...

a)

...only capital letters.

b)

...any number, letter or an underscore (_).

c)

...any letter or symbol.

d)

...any letter or an underscore (_).

39.

What would the program display if you ran this code and entered 2 and then 3 when prompted?

a)

The total is 5.

b)

The total is 23.

c)

The total is 6.

d)

An error.

40.
Returns the remainder from division
a)
modulus
b)
exponents
c)
boolean
d)
variables
41.
Surrounds multi-line comments
a)
"""
b)
**
c)
#
d)
%
42.
Symbol used for modulus
a)
%
b)
&
c)
#
d)
**
43.
10= 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
44.
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
45.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
46.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
47.
Look at this code, how many times will it loop?
a)
50
b)
90
c)
0
d)
4
48.
Look at this code, what shape will it make?
a)
Square
b)
Triangle
c)
Rectangle
d)
Hexagon 
49.
Look at this code, what is the variable? 
a)
0
b)
4
c)
for
d)
i
50.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
51.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
52.
What will be the output from this code?
a)
Square
b)
Triangle
c)
Circle
d)
Rectangle
53.
What will be the output from this code?
a)
Square
b)
Triangle
c)
Circle
d)
Rectangle
54.
What will be the output from this code?
a)
A star with an orange outline
b)
A solid orange star
c)
A pentagon with an orange outline
d)
A solid orange pentagon
55.
What will be the output from this code?
a)
A pentagon with an orange outline
b)
A solid orange star
c)
A star with an orange outline
d)
A solid orange pentagon
56.
This code should draw a solid orange square but it is not correct. How many errors are there?
a)
1
b)
2
c)
3
d)
4
57.
What is the output from this code?
a)
A sequence of four orange triangles
b)
An orange triangle and an orange square
c)
A sequence of three orange squares
d)
Error
58.
This code should draw a square with an orange outline but it is not correct. How many errors are there?
a)
1
b)
2
c)
3
d)
4
59.
To stop the turtle drawing you need to use which of the following commands?
a)
penup:
b)
pen_up( )
c)
penup( )
d)
penup( ):
60.
To move the turtle to  a specific position on the drawing canvas you need to use which of the following commands?
a)
set_pos( )
b)
setpos( ):
c)
setpos
d)
setpos( )
61.
When using a command to move the turtle to a specific position on the drawing canvas, the middle of the canvas is represented by which coordinates?
a)
1, 1
b)
100, 100
c)
0, 0
d)
500, 500
62.
When you want to hide the turtle pointer on the screen which command should you use?
a)
hide_turtle( )
b)
remove_turtle( )
c)
hideturtle( )
d)
turtle.disappear( )
63.
How do you tell that Python that you are going to use the turtle library?
a)
import_turtle
b)
turtle import
c)
from turtle import *
d)
from turtle import
64.

What is wrong with this piece of code

a)

Must use the American spelling of colour - "color"

b)

Remove the prefix "screen." on Line 3

c)

Don't write the name of the colour in quote marks

d)

Don't add a capital letter to "Screen"

65.

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

a)

import turtle

b)

import Turtle

c)

import.Turtle

d)

turtle import

66.

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

a)

turtle.forward(150)

b)

turtle.forward()

c)

turtle.moveforward()

d)

turtle.move.forward(150)

67.

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

a)

Nothing

b)

No full stop needed in the pen.down statement e.g. turtle.pendown()

c)

No brackets needed in the pen.down statement e.g. turtle.pen.down

d)

No turtle prefix needed in the pen.down statement e.g. pen.down()

68.

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

a)

There is no error

b)

turtle.right(90)

c)

turn.right(90)

d)

right(90)

69.

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

70.

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

71.

What is the best method of fixing errors in your code?

a)

Running and testing the code

b)

Asking your friends

c)

Reading it through again

d)

All of the above

72.

To fill a shape with the colour red, which command is correct? Choose more than 1 if required.

a)

turtle.fillcolor('Red')

b)

turtle.fillcolour('Red')

c)

turtle.fillcolor("Red")

d)

turtle.fillcolour("Red")

73.
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()
74.

Which of these commands would create a turtle named Alice?

a)

Alice = turtle.pen()

b)

Alice = Turtle.pen()

c)

Alice = Turtle.turtle()

d)

Alice = turtle.Turtle()

75.

To move the turtle to a specific position on the drawing canvas you need to use which of the following commands?

a)

set_pos( )

b)

setpos( ):

c)

setpos

d)

setposition( )