Worksheetsuntitled
Total questions: 25
Worksheet time: 19mins
What is the keyword needed to repeat code (iterate) in Python?
for
if
input
To fill the shape with the colour red (using a different colour outline), which command is best?
color("red")
fillcolor("red")
fill("red")
fillcolour("red")
In order to move the turtle 120 forward without drawing on the screen, which order is correct?
forward(120)
penup()
pendown()
pendown()
forward(120)
penup()
penup()
forward(120)
pendown()
What software do you use to write a program in Python?
Word
IDLE
Powerpoint
Excel
What shape will this create?
Triangle
Hexagon
Rectangle
Will look like the turtle is climbing stairs
Look at this code, how many times will it loop?
50
90
0
4
What keyword is used to define a function / subprogram in Python?
def
if
while
for
How do you tell python you want to use the turtle library
turtle import
import turtle
from libraries import turtle
from turtle import libraries
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)
"hello"
String
Integer
Float
Word
45
String
Integer
Float
Number
56.867
String
Integer
Float
Decimal
What will be the output?
var1=['sam', "Pam", 12,44]
var1[3]="Ram"
print(var1)
['sam', 'Pam', 12, 44]
['sam', 'Pam', 12, 'Ram']
It will give an error
['sam', 'Pam', 'Ram',44]
What will be the output?
list1=["Red","Green","Blue","Yellow"]
list1.append("Black")
print(list1)
<class 'list'>
['Red', 'Green', 'Blue', 'Yellow', 'Black']
['Black','Red', 'Green', 'Blue', 'Yellow' ]
AttributeError: 'tuple' object has no attribute 'append'
Is this the correct code for a list?
register = {"Sam", "Pheobe", Georgia", Richard"}
Yes
No
Which symbols are used to open and close a list?
( ) round brackets
( ) curly brackets
[ ] square brackets
" " speech marks
This list contains items of what data type?
String
Boolean
Float
Integer
Choose all of the following which are built in data types in Python
dict
list
set
tuple
Comparing a dictionary to Python to a dictionary for words, ____________ is each word we look up_______ is definition of the word
value, key
key, attribute
method, value
key, value
Dictionaries use _________ and keys are separated with _________
[], :
{}, ()
(), :
{}, :
A Python dictionary is called
pytn
dict
dicn
def
