Created
November 9, 2019 18:57
-
-
Save espinz/73851d113dc4fb75e5ee808b48f5cc06 to your computer and use it in GitHub Desktop.
Classes Exercise
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
class Shapes: | |
"""A shapes class.""" | |
def __init__(self): | |
self.question = input('What is your favorite type of shape? ') | |
self.triangle = "triangle" | |
self.square = "square" | |
self.circle = "circle" | |
def shape_type(self): | |
print('Your favorite shape is a', end=' ') | |
if self.question == self.triangle: | |
print(f'{self.triangle}') | |
elif self.question == self.square: | |
print(f'{self.square}') | |
else: | |
print(f'{self.circle}') | |
my_shape = Shapes() | |
my_shape.shape_type() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment