Question: Fix 5 errors in the code below so that it runs correctly. It will draw a repeating pattern from left to right until it hits
Fix 5 errors in the code below so that it runs correctly. It will draw a repeating pattern from left to right until it hits the width of the window and then will move back to the left side of the window to continue the pattern.


Question Discussion Fix 5 errors in the code below so that it runs correctly. It will draw a repeating pattern from left to right until it hits the width of the window and then will move back to the left side of the window to continue the pattern. Save & Run Load History 7 8 i def turtleLoop (jaz, maxx): 2 for x in range (10): # repeat the body 10 time 3 jaz.forward100) # go forward 100 4 jaz.right (120) # turn right 120 deg! 5 jaz. forward(100) # go forward 100 6 jaz.left(120 # turn left 120 degre if (jaz.xcor() >= maxx): # if at right edge of jaz.penup # pick up the per jaz.goto(-1 * maxx, jaz.ycor() - 100) # move 10 jaz.pendown() # put the pen dos 11 12 def turtleProcedure (width, jaz): 13 space.setup(width,width) # set the space width and 14 maxX = width / 2 # set the max x value to 15 jaz.shape('turtle') # set the shape for jaz te 16 jaz.penup # pick up the pen (don't 17 jaz.goto(-1 maxx, 100) # go to the left side of 9 dan 7 if (jaz.xcor() >= maxx): # if at right edge o 8 jaz.penup # pick up the per 9 jaz.goto(-1 * maxx, jaz.ycor() - 100) # move 10 jaz. pendown() # put the pen do 11 12 def turtleProcedure (width, jaz): 13 space.setup(width,width) # set the space width and 14 maxX = width/ 2 # set the max x value to 15 jaz.shape('turtle') # set the shape for jaz te 16 jaz. penup() # pick up the pen (don't 17 jaz.goto(-1 * maxx, 100) # go to the left side of 18 jaz.penDown() # pu the pen down to dra 19 jaz.left(60) # turn the turtle left 60 20 turtleLoop (jaz, maxx) # call the other function 21 NN 22 23 from turtle * # use the turtle library 24 from sys import * # use the system library 25 setExecutionLimit(50000) # let this take up to 50 seco 26 Space = Screen() # create a turtle screen (spa 27 28 width = 400 # set the desired width 29 jaz Turtle() # create a turtle named jaz 30 turtleProcedure (width, jaz) 31
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
