Created
March 5, 2019 16:12
-
-
Save uktechreviews/7c61911bc37143d50113051d9509911b to your computer and use it in GitHub Desktop.
Shapes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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