class Restaurant:
def __init__(self,restaurant_name,cuisine_type,**others):
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
for other in others.keys():
self.other = others[other]
def describe_restaurant(self):
print(f"The {self.restaurant_name} provides {self.cuisine_type} , deilicious!")
def open_restaurant(self):
print(f"The {self.restaurant_name} is opening")
my_restaurant = Restaurant(restaurant_name='QIN',cuisine_type='China',color='black',shuaiqi='yes')
print(my_restaurant.shuaiqi)
为什么这样会错误呢,求解答
print(my_restaurant.other)
这样却是正确的