Advertisement
kenadams53

Christmas Tree

Aug 9th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. # A Christmass tree mady in Python bt Ken Adams (9 August 2019)
  2. from shapes import Triangle, Rectangle, Oval
  3. rect1 = Rectangle()
  4. rect1.set_width(700)
  5. rect1.set_height(600)
  6. rect1.set_color("yellow")
  7. rect1.x=0
  8. rect1.y=0
  9. rect1.draw()
  10.  
  11. oval1 = Oval()
  12. oval1.set_height(60)
  13. oval1.set_width(360)
  14. oval1.set_color("fuchsia")
  15. oval1.set_x(120)
  16. oval1.set_y(510)
  17. oval1.draw()
  18. print(oval1._location())
  19.  
  20. rect1 = Rectangle()
  21. rect1.set_width(60)
  22. rect1.set_height(120)
  23. rect1.set_color("blue")
  24. rect1.x=270
  25. rect1.y=420
  26. rect1.draw()
  27. print(rect1._location())
  28.  
  29. triangle1 = Triangle()
  30. triangle1.x=150
  31. triangle1.y=450
  32. triangle1.x2=450
  33. triangle1.y2=450
  34. triangle1.x3=300
  35. triangle1.y3=270
  36. triangle1.set_color("green")
  37. triangle1.draw()
  38. print(triangle1._location())
  39.  
  40. triangle2 = Triangle()
  41. triangle2.x=180
  42. triangle2.y=360
  43. triangle2.x2=420
  44. triangle2.y2=360
  45. triangle2.x3=300
  46. triangle2.y3=150
  47. triangle2.set_color("green")
  48. triangle2.draw()
  49. print(triangle2._location())
  50.  
  51. triangle3 = Triangle()
  52. triangle3.x=240
  53. triangle3.y=210
  54. triangle3.x2=360
  55. triangle3.y2=210
  56. triangle3.x3=300
  57. triangle3.y3=90
  58. triangle3.set_color("green")
  59. triangle3.draw()
  60. print(triangle3._location())
  61.  
  62. oval1 = Oval()
  63. oval1.set_height(20)
  64. oval1.set_width(20)
  65. oval1.set_color("white")
  66. oval1.set_x(290)
  67. oval1.set_y(75)
  68. oval1.draw()
  69. print(oval1._location())
  70.  
  71. print("bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement