NEW
Font size
WorksheetsIntro to Programming: Tracy the Turtle 2
Total questions: 8
Worksheet time: 14mins
Which code makes Tracy move forward 10, then turn left and move forward 20?
distance = 10
forward(distance)
left(90)
distance = distance * 2
forward(distance)
distance = 10
forward(distance)
left(90)
forward(distance)
distance = 10
distance = distance * 2
forward(distance)
left(90)
forward(distance)
distance = 10
forward(distance)
left(90)
forward(distance)
distance = distance * 2
Variables allow you to do what?
Name different steps within code
Use a convenient name to store information in code
Name functions
Use English words to control the computer
Which code would produce this output?
What statement collects a number from the user and places it in a variable?
int(input(“What is the radius?: “))
radius = int(“What is the radius?: “)
radius = int(input(“What is the radius?: “))
radius = int input(“What is the radius?: “)
What is the correct way to ask a user for a color and store the answer as a variable?
color = input(“Give a color: “)
user_color = “Give a color: ”
input(“Give a color: “)
user_color = input(“Give a color: “)
Why are parameters useful?
They allow you to use the same function code for many different sets of input values
They allow a function to execute more quickly
They give the ability to create while loops
They let users execute the function without any input
How many parameters may be defined for a single function?
1
2
3
Any number
What is the best example of how to use a function to draw a square with sides that are 50 pixels long?
