Advertisement
Jorell_Ramos_Sinaga

restaurant.py

Jan 12th, 2021
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. class Restaurant:
  2.  
  3.     def __init__(self, name, specialty):
  4.         self.name = name
  5.         self.specialty = specialty
  6.  
  7.     def description(self):
  8.         print(f"Restaurant Name : {self.name}\t Specialty : {self.specialty}")
  9.  
  10.     def open_hours(self):
  11.         print(f"Restaurant is always open 24/7")
  12.  
  13. restaurant_1 = Restaurant('Ma Maison', 'Pastry')
  14. restaurant_1.description()
  15. restaurant_1.open_hours()
  16.  
  17. restaurant_2 = Restaurant('Rumah Makan Padang', 'Traditional Food')
  18. restaurant_2.description()
  19. restaurant_2.open_hours()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement