MrThoe

2.10.4

Sep 14th, 2022
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. # This function draws one square of the sidewalk
  2. def draw_square():
  3.     for i in range(4):
  4.         forward(50)
  5.         left(90)
  6.  
  7. # This function draw a line of squares calling the draw square
  8. # function and then turns Tracy
  9. def draw_sidewalk():
  10.     pendown()
  11.     for i in range(7):
  12.         draw_square()
  13.         forward(50)
  14.     penup()
  15.     forward(50)
  16.     left(90)
  17.  
  18. # Sets Tracy to the starting position and then calls the sidewalk function
  19. # 4 times for each side of the canvas.      
  20. penup()
  21. setposition(-200,-200)
  22. for i in range(4):
  23.     draw_sidewalk()
Advertisement
Add Comment
Please, Sign In to add comment