Guest User

Untitled

a guest
Mar 6th, 2021
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. class Restaurant():
  2.     def __init__(self, restaurant_name, cuisine_type):
  3.         self.restaurant_name = restaurant_name.title()
  4.         self.cuisine_type = cuisine_type
  5.        
  6.  
  7.     def describe_restaurant(self):
  8.         print(f"The restaurant's name is {self.restaurant_name} and the food type is {self.cuisine_type}")
  9.  
  10.     def open_restaurant(self):
  11.         print(f"The restaurant {self.restaurant_name} is open for business")
  12.  
  13. class IceCreamStand(Restaurant):
  14.     #Initiate attributes of parent class
  15.     def __init__(self, restaurant_name, cuisine_type):
  16.         super().__init__(restaurant_name, cuisine_type)
  17.         #self.flavors = []
  18.  
  19.     def flavor_types(self, *flavors):
  20.         self.flavors = flavors
  21.         for stuff in flavors:
  22.             print(stuff)
  23.  
  24.  
  25. restaurant1 = IceCreamStand('Thomas Sweet', 'ice cream')
  26. restaurant1.flavor_types(['vanilla', 'chocolate'])
  27.  
Advertisement
Add Comment
Please, Sign In to add comment