Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # A Christmass tree mady in Python bt Ken Adams (9 August 2019)
- from shapes import Triangle, Rectangle, Oval
- rect1 = Rectangle()
- rect1.set_width(700)
- rect1.set_height(600)
- rect1.set_color("yellow")
- rect1.x=0
- rect1.y=0
- rect1.draw()
- oval1 = Oval()
- oval1.set_height(60)
- oval1.set_width(360)
- oval1.set_color("fuchsia")
- oval1.set_x(120)
- oval1.set_y(510)
- oval1.draw()
- print(oval1._location())
- rect1 = Rectangle()
- rect1.set_width(60)
- rect1.set_height(120)
- rect1.set_color("blue")
- rect1.x=270
- rect1.y=420
- rect1.draw()
- print(rect1._location())
- triangle1 = Triangle()
- triangle1.x=150
- triangle1.y=450
- triangle1.x2=450
- triangle1.y2=450
- triangle1.x3=300
- triangle1.y3=270
- triangle1.set_color("green")
- triangle1.draw()
- print(triangle1._location())
- triangle2 = Triangle()
- triangle2.x=180
- triangle2.y=360
- triangle2.x2=420
- triangle2.y2=360
- triangle2.x3=300
- triangle2.y3=150
- triangle2.set_color("green")
- triangle2.draw()
- print(triangle2._location())
- triangle3 = Triangle()
- triangle3.x=240
- triangle3.y=210
- triangle3.x2=360
- triangle3.y2=210
- triangle3.x3=300
- triangle3.y3=90
- triangle3.set_color("green")
- triangle3.draw()
- print(triangle3._location())
- oval1 = Oval()
- oval1.set_height(20)
- oval1.set_width(20)
- oval1.set_color("white")
- oval1.set_x(290)
- oval1.set_y(75)
- oval1.draw()
- print(oval1._location())
- print("bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement