wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

St Michael's - Year 9 - Visual Python

Total questions: 49

Worksheet time: 25mins

Name
Class
Date
1.
What is the code required to make Turtle appear on the screen?
a)
MyName = turtle.Turtle()
b)
Turtle = MyName.Turtle()
c)
Turtle.Turtle = Turtle()
d)
Turtle = Turtle = Turtle()
2.
What is the code required to make a white window appear?
a)
Window = turtle.Screen()
b)
turtle.Screen() = window
c)
Screen.Turtle()
d)
window.Screen = Turtle()
3.
Which of the following is a sensible name for a Turtle in Python?
a)
Bob = turtle.Turtle()
b)
floccinaucinihilipilification = turtle.Turtle()
c)
pneumonoultramicroscopicsilicovolcanoconiosis = turtle.Turtle()
d)
Turtles do not need names.
4.
Which of the following is the correct way to prepare your file to be ready to use Turtle?
a)
import turtle
b)
turtle GetReady
c)
important turtle
d)
import theStuff
5.
Which of the following would make a screen which is 500 pixels tall and 500 pixels wide?
a)
turtle.setup(500,500)
b)
turtle.setup(400,600)
c)
turtle.setup(600,400)
d)
turtle.setup(000,000)
6.
Which of the following would make a screen which is wider than it is tall?
a)
turtle.setup(600,400)
b)
turtle.setup(500,500)
c)
turtle.setup(400,600)
d)
turtle.setup(000,000)
7.
Which of the following would make a screen which is taller than it is wide?
a)
turtle.setup(400,600)
b)
turtle.setup(600,400)
c)
turtle.setup(500,500)
d)
turtle.setup(000,000)
8.
Which of the following would change turtle's colour to red?
a)
MyName.color("red")
b)
MyName.colour("red")
c)
mainloop.color("red")
d)
def().colour("red")
9.
Where would you place the code to change the colour of the turtle?
a)
After the turtle has been named
b)
Before the turtle has been named
10.
Which direction does the turtle automatically face when he is born?
a)
Right
b)
Up
c)
Left
d)
Down
11.
What does turtle.mainloop() do?
a)
Ends the program but keeps it on the screen.
b)
Ends the program and closes it down.
12.
Where should turtle.mainloop() be placed in a program?
a)
The beginning of the program
b)
The end of the program
13.
What are the names of the two kinds of loops available to use in Python?
a)
For and While loops
b)
If and For loops
c)
If and While loops
d)
If and Else loops
14.
What is the name of the statement needed to make a decision in Python?
a)
If statement
b)
While statement
c)
For statement
d)
Else statement
15.
Which of the following pieces of code allows you to change the thickness of the turtle?
a)
MyName.width()
b)
MyName.thickness()
c)
MyName.wide()
d)
MyName.length()
16.
Which of the following pieces of code allows you to stop turtle drawing lines?
a)
MyTurtle.penup()
b)
MyTurtle.pendown()
c)
MyTurtle.stop()
d)
MyTurtle.pause()
17.
Look at this example: What does it do?
a)
It creates a square which is red.
b)
It creates a hexagon which is red
c)
It creates a square which is orange
d)
It creates a hexagon which is purple
18.
Look at this example: What would you need to change for it to draw a triangle?
a)
Change For X in Range (0,4): to For X in range (0,3) and change MyName.left(90) to MyName.left(120)
b)
Change For X in Range (0,4): to For X in range (0,6) and change MyName.left(90) to MyName.left(60)
c)
It already draws a triangle
d)
Change For X in Range (0,4): to For X in range (0,3) and change MyName.left(90) to MyName.left(60)
19.
Look at this example: What would you need to change for it to draw a bigger shape?
a)
Change MyName.forward(100) to any number bigger than 100.
b)
Change MyName.forward(100) to any number smaller than 100.
c)
Change MyName.left(90) to any number bigger than 90
d)
Change MyName.left(90) to any number smaller than 90
20.
Look at this example: What would you need to change for it to become green?
a)
Change MyName.color("red") to MyName.color("green")
b)
Change MyName.color("red") to MyName.colour("green")
c)
Change MyName.color("red") to MyName.colour("GREEN")
d)
Move MyName.color("red") so that it is below the For loop.
21.
If your turtle is facing up and you would like it to face left, which of the following would be correct to use?
a)
MyName.left(90)
b)
MyName.right(90)
c)
MyName.forward(100)
d)
MyName.backward(100)
22.
If your turtle is facing down and you would like it to face left, which of the following would be correct to use?
a)
MyName.right(90)
b)
MyName.left(90)
c)
MyName.forward(100)
d)
MyName.backward(100)
23.
Which of the following is an accurate description of a For Loop?
a)
Something which will run a piece of code depending on if something is true or not.
b)
Something which will repeat a section of code as long as something is true or not.
c)
Something which will repeat a section of code for each item in a list.
d)
Something which will only work if we use the word 'counter'
24.
Which of the following is an accurate example of a While Loop?
a)
Something which will run a piece of code depending on if something is true or not.
b)
Something which will repeat a section of code as long as something is true or not.
c)
Something which will repeat a section of code for each item in a list.
d)
Something which will only work if we use the word 'counter'
25.
Which of the following is an accurate example of an If Statement?
a)
Something which will run a piece of code depending on if something is true or not.
b)
Something which will repeat a section of code as long as something is true or not.
c)
Something which will repeat a section of code for each item in a list.
d)
Something which will only work if we use the word 'counter'
26.
What is the name of the program which we use to create shapes using Python?
a)
PyCharm
b)
PyFocus
c)
PyTurtle
d)
PythonPro 3.2
27.
What is the code 'def' used for?
a)
It defines a new programming keyword
b)
It lets us draw shapes and use pieces of code quickly
c)
It will not run the code associated with it unless it is told to
d)
All of these answers
28.
Look at this example: Why is the program not running?
a)
turtle.mainloop is wrong
b)
The turtle has not been named correctly
c)
The turtle has not been told to go anywhere
d)
The program does run, it draws a square.
29.
Look at this example: What do you need to add to get the program to draw a square?
a)
Add 'square(50)' beneath the For Loop
b)
Add 'def square(50)' beneath the For Loop
c)
Add 'square(length)' beneath the For Loop
d)
The code already draws a square.
30.
Look at this example: what shape does it draw?
a)
The letter S
b)
The letter T
c)
The letter P
d)
A Hexagon
31.
What is the difference between a For Loop and a While Loop?
a)
A While Loop depends on something else to run.
b)
A For Loop depends on something else to run
c)
Nothing
d)
Everything
32.
Which piece of code comes first in every program when we use turtle?
a)
import turtle
b)
window = turtle.Screen()
c)
MyName = turtle.Turtle()
d)
turtle.mainloop()
33.
What is the mathematical problem needed to work out the angles of basic shapes in turtle?
a)
360 divided by the number of sides of the shape
b)
360 added to the number of sides of the shape
c)
360 times by the number of sides of the shape
d)
360 minus the number of sides of the shape
34.
360/6 = 60. This is the angle needed to make:
a)
Hexagon
b)
Triangle
c)
Square
d)
Octagon
35.
360/3 = 120. This is the angle needed to make:
a)
Triangle
b)
Octagon
c)
Hexagon
d)
Square
36.
360/4 = 90. This is the angle needed to make:
a)
Square
b)
Triangle
c)
Octagon
d)
Rectangle
37.
360/10 = 36. This is the angle needed to make:
a)
Decagon
b)
Octagon
c)
Heptagon
d)
Dodecagon
38.
360/9 = 40. This is the angle needed to make:
a)
Nonagon
b)
Decagon
c)
Octagon
d)
Rectangle
39.
The following code creates a rectangle. Is it taller than it is wide or wider than it is tall?
a)
Wider than it is tall
b)
Taller than it is wide
40.
What shape would the following code create?
a)
A straight line
b)
A rectangle
c)
A square
d)
A Triangle
41.
How many turtles can appear on screen at once?
a)
Any number of turtles
b)
5
c)
500
d)
1
42.
How many windows can be open at once?
a)
1
b)
5
c)
500
d)
Any number of screens
43.
Which uses less lines of code?
a)
A For Loop
b)
A While Loop
c)
Writing the code out line by line
44.
How many sides does a circle have, according to Python?
a)
360
b)
1
c)
180
d)
0
45.
To fill a shape with colour, what piece of code do we use?
a)
MyName.begin_fill()
b)
turtle.mainloop(begin_fill)
c)
MyName.fill()
d)
MyName.fill_begin()
46.
The easiest letter to draw with turtle is
a)
I
b)
L
c)
O
d)
S
47.
The person who invented Python is called
a)
Guido van Rossum
b)
Larry Wall
c)
James Gosling
d)
Rasmus Lerdorf
48.
Python was created in
a)
the 1980s
b)
the 1990s
c)
2011
d)
2004
49.
The reason it was named Python was because
a)
He liked snakes
b)
The TV show Monty Python
c)
He was bitten by a snake when he was young
d)
He had a pet snake at the time.