根据你为完成练习9-1而编写的类创建三个实例,并对每个实例调用方法describe_restaurant() 。
class Restaurant:
def __init__(self, restaurant_name, cuisine_type):
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
def describe_restaurant(self):
print("The name of this restaurant is "+self.restaurant_name.title())
print("The cuisine type is "+self.cuisine_type.title())
def open_restaurant(self):
print("The restaurant is open!")
aa = Restaurant('zhang', 'xiao')
bb = Restaurant('xiao', 'he')
cc = Restaurant('xiao', 'ming')
aa.describe_restaurant()
print('\n')
bb.describe_restaurant()
print('\n')
cc.describe_restaurant()
print('\n')