scipiguy

Python 102: Smiley Face

Apr 27th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. # Python 102: Turtle smiley picture
  2.  
  3. from turtle import Turtle
  4.  
  5. tina = Turtle()
  6. tina.speed(0)
  7.  
  8. def draw_circle(t_name, x, y, col, r):
  9.     t_name.penup()
  10.     t_name.goto(x, y)
  11.     t_name.pendown()
  12.     t_name.color(col)
  13.     t_name.dot(r*2)
  14.  
  15. draw_circle(tina, 0, 0, "yellow", 200)
  16. draw_circle(tina, 80, 40, "white", 60)
  17. draw_circle(tina, -80, 40, "white", 60)
  18. draw_circle(tina, 90, 45, "blue", 30)
  19. draw_circle(tina, -70, 45, "blue", 30)
  20.  
  21. tina.penup()
  22. tina.goto(60, -80)
  23. tina.pendown()
  24. tina.width(10)
  25. tina.color("red")
  26. tina.right(90)
  27. for x in range(1,180,2):
  28.     tina.forward(2)
  29.     tina.right(2)
  30. tina.right(90)
  31. tina.forward(115)
Advertisement
Add Comment
Please, Sign In to add comment