NEW
Font size
WorksheetsPython Programming
Total questions: 35
Worksheet time: 3hrs 55mins
Which is used in programming languages to map the variable and object?
=
==
!=
#
Failure
1. When the following for loop is complete, how many spaces will Tracy have moved?
for i in range(5):
forward(10)
50
60
10
5
How many times can you call the function in your code?
once
depends on the function
as many times as you want
not more than once
1. Which of the following pieces of code will make Tracy do the following actions three times: go forward, change colors, and then turn around.
for i in range(4):
forward(30)
color("blue")
left(180)
for i in range(3):
forward(30)
color("blue")
left(180)
color("red")
for i in range(3):
backward(30)
color("blue")
left(180)
forward(30)
color("blue")
left(180)
forward(30)
color("green")
left(180)
forward(30)
color("orange")
left(180)
1. Suppose you want to make Tracy draw a mountain range, like the one shown below, starting from the left side.
Which of the following functions would be the most useful function to write in order to solve this problem?
def make_triangle():
def change_to_red():
def move_100():
def my_function():
Which of the following is NOT a command you can give to Tracy?
left
backward
turn
color
Which of the statements below is true about indentation in Python?
Indentation only matters in for loops.
Indentation never matters in Python.
Indentation always matters in Python.
Indentation only matters in functions.
