'''lecture_16_copy_bugs.py Instructions: Find 2 bugs in the below code Oliver W. Layton CS 151: Computational Thinking: Visual Media Spring 2021 ''' import turtle def make_turtle(): return turtle.Turtle() def copy_turtle_1(turt): '''Returns a copy of `turt`, which now has all the same properties as `turt`''' new_turt = turt.clone() # BUG 1 fixed # new_turt = turtle.Turtle() # new_turt = turt # BUG 1: shallow copy, going to return a NEW turtle. return new_turt def copy_turtle_2(turt): # turt.clone() # BUG 2: no return statement return turt.clone() # BUG 2 fix screen = turtle.Screen() # Make a classic shape turtle turt1 = make_turtle() turt1.shape('classic') # Make turtle 2 a copy of turtle 1 turt2 = copy_turtle_2(turt1) # BUG 2: Would return None, assigned to turt2 if we had no return statement turt2.shape('turtle') # Make a turtle, copy the turtle shape from turtle 2 to turtle 3 turt3 = copy_turtle_1(turt2) turt1.goto(-100, -100) turt2.goto(300, 0) turt3.goto(200, 200) # Expected result: turt1 at (-100, -100), turt2 at (300, 0), turt3 at (200, 200) screen.exitonclick()