Skip to content

Instantly share code, notes, and snippets.

@uktechreviews
Created March 5, 2019 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uktechreviews/7c61911bc37143d50113051d9509911b to your computer and use it in GitHub Desktop.
Save uktechreviews/7c61911bc37143d50113051d9509911b to your computer and use it in GitHub Desktop.
Shapes
from shapes import Triangle, Rectangle, Oval
rect1 = Rectangle()
rect1.set_width(200)
rect1.set_height(100)
rect1.set_color("blue")
rect1.set_x(0)
rect1.set_y(0)
rect1.draw()
rect2 = Rectangle()
rect2.set_width(50)
rect2.set_height(150)
rect2.set_color("yellow")
rect2.set_x(100)
rect2.set_y(100)
rect2.draw()
tri = Triangle(25, 25, 100, 25, 100, 200)
tri.draw()
oval1 = Oval()
oval1.set_x(150)
oval1.set_y(150)
oval1.set_height(10)
oval1.set_width(100)
oval1.set_color("red")
oval1.draw()
input("Press Enter")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment