The answer to this very straightforward.
class Restaurant:
def __init__ (self, restaurant_name, cuisine_type):
self.name = restaurant_name
self.type = cuisine_type
def describe_restaurant(self):
print(f"This restaurant's name is: '{self.name.title()}' and serves {self.type}")
def restaurant_open(self):
print(f"'{self.name.title()}' is currently open")
res1 = Restaurant('pho hung', 'vietnamese pho')
res1.describe_restaurant()
res2 = Restaurant('macdonalds', 'american fast')
res2.describe_restaurant()
res2.restaurant_open()
Output would be:
This restaurant's name is: 'Pho Hung' and serves vietnamese pho
This restaurant's name is: 'Macdonalds' and serves american fast
'Macdonalds' is currently open
Reference: