黑马程序员技术交流社区
标题:
python小白问题求解答:调用类提示takes no arguemnts
[打印本页]
作者:
小派僧
时间:
2020-9-27 14:16
标题:
python小白问题求解答:调用类提示takes no arguemnts
创建类之后,每次运行都提示 Restaurant takes no arguments. 请问哪里有问题呀?
class Restaurant():
def _init_(self, restaurant_name, cuisine_type):
self.name = name
self.cuisine_type = cuisine_type
def describe_restaurant(self):
print("The restaurant is "+ self.name.title()+".")
print("The cuisine type is "+ self.cuisine_type.title()+".")
def open_restaurant(self):
print("The restaurant: "+ self.name.title + " is now opening!")
res_1 = Restaurant('Tangren' , 'Chinese food')
res_1.describe_restaurant()
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2