-
Notifications
You must be signed in to change notification settings - Fork 0
/
restaurant.py
37 lines (26 loc) · 1.12 KB
/
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
30
31
32
33
34
35
36
#!/usr/bin/env python
# coding: utf-8
# In[3]:
'''A simple attempt to model a restaurant'''
class Restaurant:
def __init__(self,name,cusine_type):
"""Creating a restaurant class"""
self.name = name
self.cusine_type = cusine_type
self.number_served = 0
def describe_restaurant(self):
"""this method is for displaying name and type only"""
print(f"The Restaurant name is {self.name.title()}.")
print(f"A {self.cusine_type.title()}-type of restaurant.")
def open_restaurant(self):
"""Check if restaurant is open/closed."""
print(f"The restaurant, {self.name.title()} is open now.")
def customer_served(self):
"""How many customer we have served"""
print(f'This restaurant has served over-{self.number_served} customers.')
def set_number_served(self,number):
"""change value of customer we have served"""
self.number_served = number
def increment_number_served(self,number):
'''increment value od customer served'''
self.number_served += number