WorksheetsProgramming with Turtle Graphics Review 2
Total questions: 24
Worksheet time: 13mins
What punctuation is needed to begin a multi-line comment?
#
"
"""
*
Comments are:
Written for humans to read and understand
Only needed when a program is over 50 lines
Commands performed by the computer
Always blue when Python recognizes them
What symbol is used at the beginning of an in-line comment?
"
!
#
:
If I am creating a function that is going to draw 2 squares, which of the following would be the best name option?
Draw_Two_Squares
draw_squares
draw_shapes
2_squares
Which of the names below follow all naming rules?
my_function
Draw a Circle
4_circles
make_square
Which of the following is NOT a way functions make our code more readable?
Function names can describe what the function is completing
Functions break our code into smaller, separate parts
Each function only contains one command
Functions shorten our code by reusing code that has already been written
What two things must be included in your function definition?
A function name and commands to be performed
Function variables and commands to be performed
Commands to be performed and function arguments
A function name and function variables
Which is the proper way to call the function three_circles?
def three_circles:
three_circles():
def three_circles():
three_circles()
How would I change Tracy’s trail to a yellow line with a thickness of 10 pixels?
Color(Yellow)
thickness(10)
color(“yellow”)
pensize(10)
color yellow()
pensize(10)
color yellow():
pensize(10)
What would be the output of the following command?
circle(50,180,3)
What is true of Tracy’s color command?
You can only use hex color codes
There are 10 different colors that Tracy knows
The color name must have underscores between words (ex: light_blue)
The color name must be in quotation marks
What would be the output of the following command?
circle(50,360,5)
What is the correct way to draw a circle that is filled in?
begin_fill()
circle(20)
end_fill()
circle(20)
begin_fill()
end_fill()
circle(begin_fill, 20, end_fill)
circle(20)
end_fill()
Which of the following is NOT an example of using Top Down Design?
Breaking a large code up into functions
Writing code for one part of a function before tackling the whole thing
Using descriptive names for variables
Separating a large problems into smaller ones
Top Down Design makes it easier to solve a problem by:
Breaking the problem down into smaller parts
Starting your code from the first command
Starting with the biggest function and then moving to smaller ones
Making each function hold only one command
Which of the following programs would produce this output?
Variables allow us to:
Name different parts of our programs
Use english words to communicate with Tracy
Store information to use in our programs
Change the words Tracy recognizes
Which program will have Tracy move forward 10, then turn left and move forward 20?
How would I collect a number from the user to use for the radius of a circle?
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: ")
The name color cannot be used for our variable because:
Variable names cannot only be 1 word
The word color is already used as a Tracy command
The word color needs to be capitalized to be used as a variable name
Variable names must include underscores
How many parameters can we use in each function?
1
2
4
As many as we need
Why are parameters useful?
They allow us to tailor functions to be used in multiple situations
They allow us to change the order of commands in a function
They give us the ability to use variables in loops
They allow the user to give input
What is the best way to write a program that uses parameters to draw a square with sides that are 50 pixels long?
