Advertisement
Nizarus

randomshapes

Jul 22nd, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. from shapes import Paper, Triangle, Rectangle, Oval
  2. def draw_shapes(type):
  3.     paper=Paper()
  4.     if type=="triangle":
  5.         x=Triangle()
  6.         x.randomize()
  7.         x.draw()
  8.     elif type=="circle":
  9.         x=Oval()
  10.         x.randomize
  11.         x.draw()
  12.     elif type=="rectangle":
  13.         x=Rectangle()
  14.         x.randomize()
  15.         x.draw()
  16.     paper.display()
  17.  
  18.    
  19. draw_shapes("circle")
  20. draw_shapes("triangle")
  21. draw_shapes("rectangle")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement