Python从入门到实践 第九章课后习题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("The restaurant'name is "+self.restaurant_name)
        print("The restaurant'cuisine type is "+self.cuisine_type)
    def open_restaurant(self):
        print("The restaurant is opening!")
    
restaurant=Restaurant('xkl','chuancai')
print(restaurant.restaurant_name)
print(restaurant.cuisine_type)
restaurant.describe_restaurant()
restaurant.open_restaurant()


版权声明:本文为zhijiantianya原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。