Advertisement
here2share

# t_xmas_tree.py

Dec 28th, 2018
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. # t_xmas_tree.py
  2.  
  3. from turtle import *
  4.  
  5. do = Turtle()
  6. do.speed(10)
  7. do.shape("triangle")
  8. bgcolor("black")
  9.  
  10. do.hideturtle()
  11.  
  12. do.penup()
  13. do.goto(0,140)
  14. do.pendown()
  15. do.color("yellow")
  16. do.write("*", False, "center", font=("Wide Latin", 90))
  17.  
  18. do.color("Lime Green")
  19. do.pensize(5)
  20. do.penup()
  21. do.goto(0,200)
  22. do.pendown()
  23.  
  24. x = 10
  25. y = 200
  26. h = 8
  27. for c in range(h):
  28.     x = x + 20
  29.     y = y - 40
  30.     do.goto(-x, y-30)
  31.     do.goto(0, y+20)
  32.     do.goto(x,y-30)
  33.     if c < h-1:
  34.         do.goto(0, y)
  35.    
  36. do.penup()
  37. x = 15
  38. y = y - 5
  39. do.goto(x,y)
  40. do.color("burlywood4")
  41. do.pendown()
  42. do.pensize(5)
  43.  
  44. for c in range(h*2):
  45.     do.goto(-x, y)
  46.     do.goto(x,y)
  47.     y = y - 3
  48.  
  49. do.penup()
  50. do.goto(0,-250)
  51.  
  52. do.color("red")
  53. do.write("Merry Christmas !!!", False, "center", font=("Showcard Gothic", 40))
  54.  
  55. done()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement