Tracey The Turtle Answers Codehs

9 September 2022
4.7 (114 reviews)
34 test answers

Unlock all answers in this set

Unlock answers (30)
question
2.1.4: Stretched Slinky
answer
circle(35) forward(40) circle(35) forward(40) circle(35) forward(40) circle(35) forward(40) circle(35) forward(40)
question
2.2.4: Shorter Dashed Line
answer
penup() backward(200) pendown() forward(50) penup() forward(50) pendown() forward(50) penup() forward(50) forward(50) penup() forward(50) pendown() forward(50) penup() forward(50) pendown()
question
2.2.5: Caterpillar
answer
circle(20) penup() forward(40) pendown() circle(20) penup() forward(40) pendown() circle(20) penup() forward(40) pendown() circle(20) penup() forward(40) pendown() circle(20) penup() forward(40) pendown() penup()
question
2.3.5: Rectangle
answer
forward(50) left(90) forward(100) left(90) forward(50) left(90) forward(100) left(90)
question
2.3.6: 4 Columns
answer
penup() left(90) forward(200) right(90) right(90) pendown() forward(400) penup() left(90) forward(100) left(90) pendown() forward(400) penup() left(90) left(90) forward(400) right(90) forward(200) right(90) pendown() forward(400)
question
2.4.5: Row of Circles
answer
pendown() backward(190) for i in range (20): pendown() circle(20) penup() forward(20)
question
2.4.6: 4 Columns 2.0
answer
pendown() backward(190) for i in range (20): forward(200) right(90) right(90) pendown() forward(400) penup() left(90) forward(100) left(90) pendown() forward(400) penup() left(90) left(90) forward(400) right(90) forward(200) right(90) pendown() forward(400)
question
2.5.5: Hexagon
answer
left(30) for i in range(6): forward(50) left(60)
question
2.5.6: 'X' Marks the Spot
answer
left(45) for i in range(4): forward(100) backward(100) left(90)
question
2.5.7: Circle Pyramid
answer
penup() setposition(-100,-200) for i in range (3): pendown() circle(50) penup() forward(100) setposition(-50,-100) for i in range (2): pendown() circle(50) penup() forward(100) setposition(0,0) for i in range (1): pendown() circle(50) penup() forward(100)
question
2.6.4: Circle Pyramid with Comments
answer
"""In this code Tracey will build a pyrimid""" penup() setposition(-100,-200) for i in range (3): pendown() circle(50) penup() forward(100) setposition(-50,-100) #Now Tracey will draw a circle for i in range (2): pendown() circle(50) penup() forward(100) setposition(0,0) for i in range (1): pendown() circle(50) penup() forward(100) #Now Tracey will take a break
question
2.8.4: Beaded Bracelet
answer
"""this code will make Tracey a bead bracelet for her b-day""" def draw_beaded_braclet(): for i in range(36): forward(10) pendown() circle(10) left(10) penup() draw_beaded_braclet()
question
2.8.5: Shape Stack
answer
"""This code will help Tracey put her toy blocks into a tall stack""" def draw_circle_stack(): for i in range(4): pendown() circle(25) forward(100) def draw_square_stack(): left(90) for i in range(4): pendown() left(90) circle(50, 360, 4) draw_square_stack() draw_circle_stack()
question
2.9.5: Four Colored Triangles
answer
penup() backward(100) def draw_loop_thingy(): for i in range(4): pensize(5) pendown() left(60) color("green") draw_loop_thingy() forward(50) right(120) color("blue") forward(50) color("red") right(120) forward(50) penup() left(180) forward(50)
question
2.9.6: Colorful Bracelet
answer
"""this code will make Tracey a bead bracelet for her b-day""" def draw_beaded_braclet(): for i in range(36): color("purple") forward(10) pendown() circle(10) left(10) penup() color("blue") forward(10) color("red") draw_beaded_braclet()
question
2.11.4: Dartboard
answer
penup() radius=2 for i in range(25,101,25): setposition(0,0) right(90) forward(i) left(90) pendown() circle(i) penup() def draw_something(): forward(20)
question
2.11.5: Line of Increasing Blocks
answer
speed(3) size=10 def make_square(): for i in range(4): pendown() forward(size) left(90) setposition(-150,0) for i in range(5): make_square() penup() forward(2*size) size=size+10
question
2.12.4: Colored Dartboard
answer
radius=100 for i in range(4): penup() setposition(0,0) right(90) forward(radius) left(90) color_choice= input("what color should the circle be?") color(color_choice) begin_fill() circle(radius) end_fill() radius=radius-25
question
2.12.5: Four Corners
answer
int(input("square_length")) penup() setposition(-200,-200) pendown() left(90) for i in range(4): forward(50) right(90) penup() forward(400) pendown() right(90) for i in range(4): forward(50) right(90) forward(400) pendown() right(90) for i in range(4): forward(50) right(90) forward(400) pendown() right(90) for i in range(4): forward(50) right(90)
question
2.13.4: Colorful Caterpillar
answer
penup() setposition(-150,0) pendown() def make_caterpillar(color_choice): color(color_choice) begin_fill() circle(20) end_fill() make_caterpillar("blue") penup() forward(40) pendown() make_caterpillar("green") penup() forward(40) pendown() make_caterpillar("yellow") penup() forward(40) pendown() make_caterpillar("red") penup() forward(40) pendown() make_caterpillar("blue") penup() forward(40) pendown() make_caterpillar("green") penup() forward(40) pendown() make_caterpillar("yellow") penup() forward(40) pendown() make_caterpillar("red") for i in range(4): penup()
question
2.13.5: Circle in a Square
answer
first_radius=int(input("what is the first circle's radius?:")) def draw_square_big(color_choice, radius_choice): penup() backward(first_radius) pendown() color(color_choice) begin_fill() for i in range(4): forward(first_radius*2) left(90) end_fill() def draw_circle_wide(color_choice, radius_choice): pendown() color(color_choice) begin_fill() circle(radius_choice) end_fill() penup() setposition(0,-first_radius) draw_square_big("red", first_radius) penup() setposition(0,-first_radius) draw_circle_wide("blue", first_radius)
question
2.13.6: Snowman
answer
# put imput inputs = [100] #functions def draw_circle(radius): pendown() begin_fill() circle(radius) end_fill() penup() left(90) forward(radius*2) right(90) penup() setposition(0,-200) color("gray") bottom_radius = int(input("What should the radius of the bottom circle be?: ")) #parameters draw_circle(bottom_radius) draw_circle(bottom_radius/2) draw_circle(bottom_radius/4)
question
2.14.4: Geometry 2.0
answer
penup() setposition(0,-100) pendown() radius = 20 for i in range(7): circle(radius,360,i) radius=(radius + 20)
question
2.15.4: Dartboard using i
answer
penup() radius=2 for i in range(25,101,25): setposition(0,0) right(90) forward(i) left(90) pendown() circle(i) penup() def draw_something(): forward(20)
question
2.15.5: Phone Signal
answer
for i in range(10, 51, 10): forward(10) left(90) forward(i) left(90) forward(10) left(90) forward(i) left(90) penup() forward(25) pendown()
question
2.16.4: Happy Face
answer
inputs = ["Yes"] def draw_eye(): color("black") begin_fill() pendown() circle(10) end_fill() penup() happy = input("Are you happy? (Yes/No): ") if happy == "Yes": penup() right(90)
question
2.16.5: Black and White Squares
answer
inputs = ["Yes"] def draw_black_square(): color("black") begin_fill() pendown() circle(10) end_fill() penup() black = input("Is square black? (Yes/No): ") if black %"Yes": penup() right(90) for i in range(1): pendown()
question
2.17.4: Rating
answer
rating= 8 def red_ex(): pensize(5) color("red") left(45) for i in range(4): forward(100) backward(100) left(90) def yellow_line(): pensize(5) color("yellow") forward(100) def green_check(): pensize(5) color("green") left(45) for i in range(2): forward(100) backward(100) number = int(input("Enter a number: ")) if number < 5: red_ex() elif number == 7: yellow_line() else: green_check()
question
Happy/ Sad Face
answer
inputs = ["Yes"] def draw_eye(): color("black") begin_fill() pendown() circle(10) end_fill() penup() happy = input("Are you happy? (Yes/No): ") if happy == "Yes": penup() right(90)
question
2.18.4: Increasing Squares
answer
length = 50 speed(0) #while loop for drawing the squares def drawSquare(l): for i in range(4): forward(l) left(90) while length < 400: penup() backward(length/2) right(90) forward(length/2) left(90) pendown() drawSquare(length) penup() forward(length/2) left(90) forward(length/2) right(90) length = length + 50
question
2.18.5: Guess a Number
answer
"tracy is ask user to guess number from 1-10" #user number user_number= int(input("Pick a number from 1-10?:")) #variable for secret , secret_number=7 def draw_checkmark(): penup() backward(50) right(90) pendown() pensize(15) color("green") left(45) forward(50) left(90) forward(100) penup() draw_checkmark()
question
2.19.4: Guess a Number 2.0
answer
"tracy is ask user to guess number from 1-10" #user number user_number= int(input("Pick a number from 1-10?:")) #variable for secret number secret_number=7 def draw_checkmark(): penup() backward(50) right(90) pendown() pensize(15) color("green") left(45) forward(50) left(90) forward(100) penup() draw_checkmark() if user_number < 5: circle(50) elif count > 5: circle(50,360,4) else: forward(50)
question
2.19.5: Circle Pyramid 2.0
answer
radius = int(input("What is the radius of the circle? ")) row_value= int(input("What is the row value of the circle? ")) def row_value(): setposition(0, radius) for i in range(15): circle(25) row_value()
question
2.19.6: Checkerboard
answer
speed(0) def move_up_a_row(): left(90) forward(40) right(90) backward(400) def square(): for i in range(4): forward(40) left(90) def draw_two_square_rows(): color_value= 0 for i in range(10): pendown() if color_value % 2 == 0: color_value= color_value+ 1 color("black") else: color_value= color_value+ 1 color("red") begin_fill() square() end_fill() penup() forward(40) move_up_a_row() for i in range(10): pendown() if color_value % 2 == 0: color_value= color_value+ 1 color("red") else: color_value= color_value+ 1 color("black") begin_fill() square() end_fill() penup() forward(40) # Send Tracy to starting position in bottom left corner. penup() setposition(-200,-200) # Call square drawing function for i in range(5): draw_two_square_rows() left(90) forward(40) left(90) forward(400) left(180)