|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
class Restaurant():
def _init_(self,restaurant_name,cuisine_type):
self.restaurant_name=name
self.cuisine_type=cuisine
def describe_restaurant(self):
print(self.name.title() + " provides " + self.cuisine.title())
def open_restaurant(self):
print(self.name.title()+'正在营业。')
restaurant=Restaurant ('四季','four seasons')
describe_restaurant(restaurant)
open_restaurant(restaurant)
这串代码为什么会报这个错误:Traceback (most recent call last):
File "C:/Users/zjm16/Desktop/python/25.py", line 13, in <module>
restaurant=Restaurant ('四季','four seasons')
TypeError: Restaurant() takes no arguments
>>>
|
|