stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
coding units 1-3 Flashcards | StudBud
Explore
/
coding units 1-3
coding units 1-3
29 terms
·
StudBud Administration
·
6 plays
python
Flashcards
29 cards
F
Practice quiz
P
Host live
L
Questions
29
Answers
1
The setposition() command moves Tracy to a coordinate and:
does not turn her
turns her to face up
turns her to face down
turns her to face left
2
Why do certain words change color in Python?
To tell Python to skip these words when running the code
To show you that these words can be clicked
To show that they are recognized as key words
To tell you that these words cannot be used in Python code
3
Which is the proper way to call the function three_circles?
def three_circles():
def three_circles:
three_circles()
three_circles():
4
How would I change Tracy’s trail to a yellow line with a thickness of 10 pixels?
color(“yellow”) pensize(10)
Color(Yellow) thickness(10)
color yellow(): pensize(10)
color yellow() pensize(10)
5
Where does Tracy always start in the grid world?
At the (-200,-200) coordinate in the middle of the canvas
At the (0,0) coordinate in the middle of the canvas
At the (0,0) coordinate in the bottom left hand corner of the canvas
At the (-200,-200) coordinate in the bottom left hand corner of the canvas
6
How far does Tracy need to move from the starting position to reach the right side of the canvas?
200 pixels
400 pixels
100 pixels
50 pixels
7
Which of the names below follow all naming rules?
4_circles
make_square
Draw a Circle
my_function
8
Which of the following is NOT a reason for loops are useful when writing code?
Loops help us write the same program with fewer lines of code
Loops make it easier to alter code once it’s written
Loops make our code easier to read
Loops let us make shapes of multiple sizes
9
How would I tell Tracy to move forward 100 pixels?
forward(100)
forward 100
Tracy, move forward 100 pixels
move(100)
10
If you wanted Tracy to complete her command immediately, which speed value would you use?
0
10
5
1
11
Top Down Design makes it easier to solve a problem by:
Starting your code from the first command
Making each function hold only one command
Starting with the biggest function and then moving to smaller ones
Breaking the problem down into smaller parts
12
What two things must be included in your function definition?
Function variables and commands to be performed
A function name and function variables
Commands to be performed and function arguments
A function name and commands to be performed
13
What symbol is used at the beginning of an in-line comment?
!
#
:
"
14
If you want Tracy to move forward 100 pixels without making a line, what set of commands should you write?
forward(-100)
forward(100) penup()
penup() forward(100)
penup(100)
15
When using the circle() command, what value do we put inside the parentheses?
The radius of the circle
The center of the circle
The diameter of the circle
The width of the circle
16
When Tracy is facing right, from what location does she start drawing her circle?
The middle of the circle
The left side of the circle
The bottom of the circle
The top of the circle
17
If Tracy started facing R, which direction would she face after ran the following code? left(90) left (90) right(90)
left
down
up
right
18
Comments are:
Only needed when a program is over 50 lines
Commands performed by the computer
Written for humans to read and understand
Always blue when Python recognizes them
19
If I am creating a function that is going to draw 2 squares, which of the following would be the best name option?
draw_squares
Draw_Two_Squares
2_squares
draw_shapes
20
What punctuation is needed to begin a multi-line comment?
#
*
"""
"
21
Tracy always starts facing which direction?
east
west
north
south
22
If I use the command right(180), which way will Tracy turn?
She will turn to face up
She will turn around
She will turn to face left
She will turn in a circle
23
What is the correct way to draw a circle that is filled in?
begin_fill() circle(20) end_fill()
circle(20) end_fill()
circle(begin_fill, 20, end_fill)
circle(20) begin_fill() end_fill()
24
What are the dimensions of Tracy’s world?
200 pixels x 200 pixels
400 pixels x 400 pixels
200 pixels x 400 pixels
400 pixels x 200 pixels
25
Which of the following is NOT a way functions make our code more readable?
Functions shorten our code by reusing code that has already been written
Each function only contains one command
Functions break our code into smaller, separate parts
Function names can describe what the function is completing
26
If Tracy is facing R, which commands can B used 2 turn her face up? A left(90) B turn(up) C right(-90) D setposition(90)
A, B, C, and D
A and C
A only
A, B, and C
27
Which of the following is NOT an example of using Top Down Design?
Separating a large problems into smaller ones
Writing code for one part of a function before tackling the whole thing
Using descriptive names for variables
Breaking a large code up into functions
28
Which commands would move Tracy forward 100 pixels? A. forward(100) B. backward(-100) C. forward(-100)
A, B, and C
A and B
B and C
A only
29
What is true of Tracy’s color command?
The color name must have underscores between words (ex: light_blue)
You can only use hex color codes
There are 10 different colors that Tracy knows
The color name must be in quotation marks