'''lecture_15_copy_bugs.py Instructions: Find 2 bugs in the below code Oliver W. Layton CS 151: Computational Thinking: Visual Media Fall 2020 ''' 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 = turtle.Turtle() # This line not needed # new_turt = turt # BUG 1: shallow copy, not deep copy. turt3 will be shallow copy of turt2 new_turt = turt.clone() return new_turt def copy_turtle_2(turt): # turt.clone() # BUG 2: need to return the clone/deep copy of turt return turt.clone() # BUG 2: need to return the clone/deep copy of turt 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) # print(turt2) 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()