赞
踩
TypeError: 'str' object is not callable
我的代码如下所示
- class Restaurant():
- '''描述餐馆的基本属性'''
- def __init__(self,restaurant_name,cuisine_type):
- self.restaurant_name = restaurant_name
- self.cuisine_type = cuisine_type
-
- def describe_restaurant(self):
- '''描述餐馆'''
- print("This restaurant's type is " + self.cuisine_type + " . ")
- print("This restaurant's name is " + self.restaurant_name.title() + ".")
-
- def open_restautant(self):
- '''餐馆营业提醒'''
- print("Welcom our" + self.cuisine_type + " " + self.restaurant_name +" restaurant !" )
-
-
- restaurant_1 = Restaurant('Mandclo' ,'fast restaurant')
- restaurant_2 = Restaurant('水煮鱼','中餐厅')
- restaurant_3 = Restaurant('千岛酱','日本菜')
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。