Advertisement
HexaCoder

1.8 Drawing shapes on Python

May 23rd, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. from shapes import Triangle, Rectangle, Oval, Paper
  2.  
  3.  
  4. rect = Rectangle()
  5.  
  6. rect.set_width(400)
  7. rect.set_height(325)
  8. rect.set_color("blue")
  9. rect.set_x(150)
  10. rect.set_y(75)
  11.  
  12. rect.draw()
  13.  
  14. ovo1 = Oval()
  15. ovo1.set_color("white")
  16. ovo1.set_width(400)
  17. ovo1.set_height(325)
  18. ovo1.set_x(150)
  19. ovo1.set_y(75)
  20.  
  21. ovo1.draw()
  22.  
  23. ovo = Oval()
  24. ovo.set_color("green")
  25. ovo.set_width(390)
  26. ovo.set_height(315)
  27. ovo.set_x(155)
  28. ovo.set_y(80)
  29.  
  30. ovo.draw()
  31.  
  32. rectw = Rectangle()
  33.  
  34. rectw.set_width(310)
  35. rectw.set_height(235)
  36. rectw.set_color("white")
  37. rectw.set_x(195)
  38. rectw.set_y(120)
  39.  
  40. rectw.draw()
  41.  
  42.  
  43. rectl = Rectangle()
  44.  
  45. rectl.set_width(300)
  46. rectl.set_height(225)
  47. rectl.set_color("red")
  48. rectl.set_x(200)
  49. rectl.set_y(125)
  50.  
  51. rectl.draw()
  52.  
  53. tri = Triangle()
  54.  
  55. tri = Triangle(200, 350, 500, 350, 350, 125, "black")
  56. tri.draw()
  57.  
  58.  
  59. Paper.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement