elena_gancedo

4 rectangles

Aug 2nd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. import turtle
  2. elena=turtle.Turtle()
  3. elena.shape('circle')
  4. elena.color('blue')
  5. elena.penup()
  6. elena.goto(-60,-120)
  7. elena.write("Let's make 4 rectangles!")
  8. elena.goto(0,50)
  9. elena.pendown()
  10. def rectangle():
  11.     elena.begin_fill()  
  12.     elena.left(0)
  13.     elena.forward(130)
  14.     elena.left(90)
  15.     elena.forward(90)
  16.     elena.left(90)
  17.     elena.forward(130)
  18.     elena.left(90)
  19.     elena.forward(90)
  20.     elena.end_fill()
  21. rectangle()
  22. elena.color('green')
  23. rectangle()
  24. elena.color('red')
  25. rectangle()
  26. elena.color('yellow')
  27. rectangle()
Advertisement
Add Comment
Please, Sign In to add comment