You are on page 1of 2

������ 9_1

class Restaurant():

def __init__(self,restaurant_name,cuisine_type):

self.restaurant_name=restaurant_name

self.cuisine_type=cuisine_type

def describe_restaurant(self):

print(self.restaurant_name.title())

print(self.cuisine_type.title())

def open_restaurant(self):

print(self.restaurant_name.title()+ " is open")

my_restaurant=Restaurant('at home is better', 'ukranian')

his_restaurant=Restaurant('ROloe', 'chinese')

her_restaurant=Restaurant('OE', 'ukranian')

my_restaurant.describe_restaurant()

his_restaurant.describe_restaurant()

her_restaurant.describe_restaurant()

������ 9_3
class User():

def __init__(self,first_name,last_name,age,live):

self.first_name=first_name

self.last_name=last_name

self.age=age

self.live=live

def describe_user(self):

print(self.first_name.title())

print(self.last_name.title())

print(str(self.age))

print(self.live.title())

def greet_user(self):

print('Welcome '+ self.first_name.title())

my=User('dmytro','hersymchuk',27,'obuchiv')
alex=User('alex','nesmiyan',27,'obuchiv')
my.describe_user()

my.greet_user()

alex.describe_user()

alex.greet_user()
������ 9_3
class Restaurant():

def __init__(self,restaurant_name,cuisine_type):
self.restaurant_name=restaurant_name
self.cuisine_type=cuisine_type
self.number_served=0
def describe_restaurant(self):
print(self.restaurant_name.title())
print(self.cuisine_type.title())
def open_restaurant(self):
print(self.restaurant_name.title()+ " is open")
def re(self):
print("Clients = " + str(self.number_served))
def set_number_served(self,client):
self.number_served=client
def increment_number_served(self,plus):
self.number_served+=plus
my_restaurant=Restaurant('at home is better','ukranian')
his_restaurant=Restaurant('ROloe', 'chinese')
her_restaurant=Restaurant('OE', 'ukranian')
my_restaurant.describe_restaurant()
his_restaurant.describe_restaurant()
her_restaurant.describe_restaurant()
her_restaurant.set_number_served(12)
her_restaurant.re()

You might also like