-
Notifications
You must be signed in to change notification settings - Fork 0
/
9-1_Restaurant.py
29 lines (22 loc) · 1001 Bytes
/
9-1_Restaurant.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class Restaurant:
"""A class representing a restaurant"""
def __init__(self, restaurant_name, cuisine_type):
"""Initialize the restaurant name and cuisine type attributes"""
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
def describe_restaurant(self):
"""Print a description of the restaurant"""
print(f"This restaurant is called {self.restaurant_name} and they serve {self.cuisine_type} food.")
def open_restaurant(self):
"""Print a message indicating the restaurant is open"""
print(f"{self.restaurant_name} is now open!")
restaurant = Restaurant("Taco Bell", "Mexican")
print(restaurant.restaurant_name)
print(restaurant.cuisine_type)
restaurant.describe_restaurant()
restaurant.open_restaurant()
restaurant = Restaurant("Red Lobster", "Questionable Seafood")
print(f"\n{restaurant.restaurant_name}")
print(restaurant.cuisine_type)
restaurant.describe_restaurant()
restaurant.open_restaurant()