




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





CODEHS PYTHON EXAM 2024
CODEHS PYTHON EXAM 2024\2025 WITH GUARANTEED ACCURATE ANSWERS |VERIFIED How would I tell Tracy to move forward 100 pixels - ACCURATE ANSWERS✔✔ forward(100) When using the circle() command, what value do we put inside the parentheses? - ACCURATE ANSWERS✔✔ The radius of the circle When Tracy is facing right, from what location does she start drawing her circle? - ACCURATE ANSWERS✔✔ The bottom of the circle Where does Tracy always start in the grid world? - ACCURATE ANSWERS✔✔ At the (0,0) coordinate in the middle of the canvas What are the dimensions of Tracy's world? - ACCURATE ANSWERS✔✔ 400 pixels x 400 pixels
Which commands would move Tracy forward 100 pixels?A. forward(100)B. backward(-100)C. forward(-100) - ACCURATE ANSWERS✔✔ A and B Tracy always starts facing which direction? - ACCURATE ANSWERS✔✔ East If Tracy is facing right, which of the following commands can be used to turn her to face up?A. left(90)B. turn(up)C. right(-90)D. setposition(90)
If you wanted Tracy to complete her command immediately, which speed value would you use? - ACCURATE ANSWERS✔✔ 0 If you want three circles to be drawn next to each other (as seen in the image below), after drawing the first circle, how far would you need to move Tracy before drawing the next circle? - ACCURATE ANSWERS✔✔ The circle's diameter Comments are: - ACCURATE ANSWERS✔✔ Written for humans to read and understand What symbol is used at the beginning of an in-line comment? - ACCURATE ANSWERS✔✔ # What punctuation is needed to begin a multi-line comment? - ACCURATE ANSWERS✔✔ """ Which of the names below follow all naming rules? - ACCURATE ANSWERS✔✔ make_square If I am creating a function that is going to draw 2 squares, which of the following would be the best name option? - ACCURATE ANSWERS✔✔ draw_squares
Which of the following is NOT a way functions make our code more readable? - ACCURATE ANSWERS✔✔ Each function only contains one command What two things must be included in your function definition? - ACCURATE ANSWERS✔✔ A function name and commands to be performed Which is the proper way to call the function three_circles? - ACCURATE ANSWERS✔✔ three_circles() How would I change Tracy's trail to a yellow line with a thickness of 10 pixels? - ACCURATE ANSWERS✔✔ color("yellow") pensize(10) What is true of Tracy's color command? - ACCURATE ANSWERS✔✔ The color name must be in quotation marks What is the correct way to draw a circle that is filled in? - ACCURATE ANSWERS✔✔ begin_fill() circle(20) end_fill() What would be the output of the following command?circle(50,360,5) - ACCURATE ANSWERS✔✔ pentagon What would be the output of the following command? - ACCURATE ANSWERS✔✔ half of a hexagon
user_color = input("Give a color: ") - ACCURATE ANSWERS✔✔ The word 'color' is already used as a Tracy command Why are parameters useful? - ACCURATE ANSWERS✔✔ They allow us to tailor functions to be used in multiple situations How many parameters can we use in each function? - ACCURATE ANSWERS✔✔ As many as we need What is the best way to write a program that uses parameters to draw a square with sides that are 50 pixels long? - ACCURATE ANSWERS✔✔ def square_length(): for i in range(4): forward(length) left(90) make_square(50) What is the default starting value of i in a for loop? - ACCURATE ANSWERS✔✔ 0 What will the values of i be at each iteration of the loop below? for i in range(3): - ACCURATE ANSWERS✔✔ 0, 1, 2 What will happen when the value of i reaches 5 in the loop below? for i in range(5):
left(i) right(90) - ACCURATE ANSWERS✔✔ Tracy will turn 90 degrees to the right What will the values of i be at each iteration of the loop below? for i in range(2, 10, 2): - ACCURATE ANSWERS✔✔ 2, 4, 6, 8 What will be the output of the code below? penup() backward(150) for i in range(10, 50 ,10): forward(i * 2) pendown() circle(i) penup() - ACCURATE ANSWERS✔✔ four circles