Font size
WorksheetsPython Turtle Quiz
Total questions: 75
Worksheet time: 39mins
What Python Turtle function allows you to change the colour of a shape's borders?
fillcolor
pencolor
linecolor
bordercolor
which is the correct syntax for a function from the option given below?
def myFunction
myFunction()
def myFunction():
def myFunction()
What line of code is necessary to use drawing functions in Python such as fillcolor, forward, left and right?
from turtle import*
start turtle
begin_turtle
import python
Which of the following functions can be used to create a loop? (check all that apply)
for i in range
if
else
while
What would the following code draw?
A triangle pointing up
A triangle pointing to the right
A triangle pointing to the left
A triangle pointing down
What would the following code output?
A green vertical line
A green horizontal line
A green diagonal line
An error message
What would the following code output?
from turtle import*
goto(-100, 0)
A blank screen
A vertical line going from the middle of the screen straight down
A horizontal line going from the middle of the screen to the left
A horizontal line going from the middle of the screen to the right
Which of the following codes would output a circle? (check all that apply)
from turtle import*
for i in range(360):
forward(1)
left(1)
from turtle import*
dot(300)
from turtle import*
circle(300)
from turtle import*
round(300)
What Python Turtle function allows you to change the colour of a shape?
fill_color
fillcolor
shape_fill
shape_color
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)
while
if
elif
else
In turtle, we use widget instead of functions?
Yes
No
I dont know
Maybe
What is the output of the following code:
hello = 100
Print(" I would like to say " + hello)
I would like to say hello
I would like to say 100
Error
I dont know
what function prevents your turtle from drawing on the screen
(a)
create a function called Hello
(a)
What is the output of Name = print('Dave")
dave
"Dave"
Syntax Error
Dave
Which is the Python logo?
x = 5
y = 6
print(x*y)
The code above displays the following:
11
x*y
Syntax Error
30
The output of the program
x = 4
x = "Sally"
print(x)
four
Saly
Sally
Which of the following is not valid variable name in Python?
var11
11var
var_name
_var
Which of the following will give error?
a,b,c=1, 2 , 1.5
a=b=c=1
a,b,c=1
None of the above
Which of the following is a valid variable?
var@
32var
abc_a_c
class
Python only works in Linux and Windows.
True
False
Python is free and open source
True
False
Why python is popular?
Because it is easy to learn and has clear syntax.
Because it is hard to learn and has complex syntax
Because it is derived from Java
Because it is used by Apple
How do you create a variable with the numeric value 5?
x=5
x=5.0
x=int(5)
all of the above
What is the correct syntax to output the type of a variable or object in Python?
print(type(x))
print(typeof(x))
print(type of (x))
print(typeOf(x))
In Python, 'Hello', is the same as "Hello"
True
False
Cant say
both are wrong
Which operator is used to multiply numbers?
X
#
%
*
Which operator can be used to compare two values?
<>
!=
=
==
How do you start writing an if statement in Python?
if x>y :
if (x>y)
if (x>y) then:
if x is >y :
True or False:
phone.number is a good name for a variable.
True
False
True or False:
5.0 is an example of the 'float' datatype.
True
False
In this code, how much does an apple cost?
£1
50p
20p
25p
True or False:
There are no symbols which can be used in a variable name.
True
False
What is an integer?
A number with a decimal point.
A whole number.
An array of characters.
A single character.
What function converts the data in a variable into a 'float'?
int()
flt()
bool()
float()
Variable names can start with...
...only capital letters.
...any number, letter or an underscore (_).
...any letter or symbol.
...any letter or an underscore (_).
What would the program display if you ran this code and entered 2 and then 3 when prompted?
The total is 5.
The total is 23.
The total is 6.
An error.
Which of the following is used in Python to calculate ten squared?
What is wrong with this piece of code
Must use the American spelling of colour - "color"
Remove the prefix "screen." on Line 3
Don't write the name of the colour in quote marks
Don't add a capital letter to "Screen"
There is an error on this piece of code, what is the correct statement?
import turtle
import Turtle
import.Turtle
turtle import
There is an error on this piece of code, what is the correct statement?
turtle.forward(150)
turtle.forward()
turtle.moveforward()
turtle.move.forward(150)
There is an error on this piece of code, what is wrong?
Nothing
No full stop needed in the pen.down statement e.g. turtle.pendown()
No brackets needed in the pen.down statement e.g. turtle.pen.down
No turtle prefix needed in the pen.down statement e.g. pen.down()
There is an error on this piece of code, how should it be written?
There is no error
turtle.right(90)
turn.right(90)
right(90)
There is an error on this piece of code, how should it be written?
There is no error
turtle.right(90)
turtle.drawcircle(10)
import.turtle
There is an error on this piece of code, how should it be written?
There is no error
turtle.right(90)
turtle.drawcircle(10)
import.turtle
What is the best method of fixing errors in your code?
Running and testing the code
Asking your friends
Reading it through again
All of the above
To fill a shape with the colour red, which command is correct? Choose more than 1 if required.
turtle.fillcolor('Red')
turtle.fillcolour('Red')
turtle.fillcolor("Red")
turtle.fillcolour("Red")
turtle.penup()
turtle.pendown()
turtle.forward(120)
turtle.penup()
turtle.forward(120)
turtle.pendown()
Which of these commands would create a turtle named Alice?
Alice = turtle.pen()
Alice = Turtle.pen()
Alice = Turtle.turtle()
Alice = turtle.Turtle()
To move the turtle to a specific position on the drawing canvas you need to use which of the following commands?
set_pos( )
setpos( ):
setpos
setposition( )
