为什么这段代码返回该消息,然后返回None?

时间:2019-01-02 16:07:36

标签: python-3.x

运行时,这段代码将打印应该打印的内容,但每个句子后面都显示None句子。有什么想法吗?

   class Restaurant:
       def __init__(self, restaurant_name, cuisine_type):
            self.restaurant_name = restaurant_name
            self.cuisine_type = cuisine_type

       def describe_restaurant(self):
           print("The restaurant is called " + self.restaurant_name.title() + " and it serves " + self.cuisine_type.upper() + " cuisine!")

       def open_restaurant(self):
            print("The " + self.restaurant_name.title() + " restaurant is now opened!")

first_restaurant = Restaurant('AAAA','BBBB')
print(first_restaurant.describe_restaurant())
print(first_restaurant.open_restaurant())

0 个答案:

没有答案