Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Restaurant():
- def __init__(self, restaurant_name, cuisine_type):
- self.restaurant_name = restaurant_name.title()
- self.cuisine_type = cuisine_type
- def describe_restaurant(self):
- print(f"The restaurant's name is {self.restaurant_name} and the food type is {self.cuisine_type}")
- def open_restaurant(self):
- print(f"The restaurant {self.restaurant_name} is open for business")
- class IceCreamStand(Restaurant):
- #Initiate attributes of parent class
- def __init__(self, restaurant_name, cuisine_type):
- super().__init__(restaurant_name, cuisine_type)
- #self.flavors = []
- def flavor_types(self, *flavors):
- self.flavors = flavors
- for stuff in flavors:
- print(stuff)
- restaurant1 = IceCreamStand('Thomas Sweet', 'ice cream')
- restaurant1.flavor_types(['vanilla', 'chocolate'])
Advertisement
Add Comment
Please, Sign In to add comment