大佬帮忙看看

weixin_44690967 2019-03-09 04:41:51

class Restaurant():
def __init__(self, name, type):
self.name = name
self.type = type
self.number_served = 0


def describe_restaurant(self):
print('this restaurant name :' + self.name)
print('this is a '+ self.type + ' restaurant')

def open_restaurant(self):
print('The restaurant is opening')

def restaurant_served(self):
print(str(self.number_served))


new_restaurant = Restaurant('juli','kuaishu')

new_restaurant.describe_restaurant()
new_restaurant.open_restaurant()
new_restaurant.restuarant_served()
错误类型:'Restaurant' object has no attribute 'restuarant_served'
为什么
...全文
65 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
陈年椰子 2019-03-09
  • 打赏
  • 举报
回复
拼写错误

restaurant_served 函数
restuarant_served 调用

37,718

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧