Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Drawing geometric figures. by Jesus Suniaga
- from shapes import Triangle,Rectangle, Oval
- rect1=Rectangle()
- rect1.set_width(200)
- rect1.set_height(100)
- rect1.set_color("blue")
- rect1.draw()
- rect2=Rectangle()
- rect2.set_width(50)
- rect2.set_height(150)
- rect2.set_color("yellow")
- rect2.set_x(150)
- rect2.set_y(150)
- rect2.draw()
- rect1.set_x(10)
- rect1.set_y(10)
- rect1.draw()
- rect3 = Rectangle()
- rect3.set_width(50)
- rect3.set_height(150)
- rect3.set_color("purple")
- rect3.set_x(210)
- rect3.set_y(210)
- rect3.draw()
- oval1 = Oval()
- oval1.set_height(50)
- oval1.set_width(100)
- oval1.set_x(250)
- oval1.set_y(80)
- oval1.set_color("green")
- oval1.draw()
- oval2 = Oval()
- oval2.randomize(20,150)
- oval2.draw()
- tri = Triangle()
- tri1 = Triangle(200, 400, 350, 420, 450, 500)
- tri1.set_color("orange")
- tri1.draw()
- tri = Triangle()
- tri2 = Triangle(10, 100, 50, 5, 50, 100)
- tri2.set_color("black")
- tri2.draw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement