2020.1.15

# test 9-6

class Restaurant():
    def __init__(self , restaurant_name , cuisine_type):
        self.name = restaurant_name
        self.type = cuisine_type
        self.number_served = 0
        
    def describe_restaurant(self):
        print("我很喜欢去" + self.name + "吃饭!")
        print("他店里的" + self.type + "很好吃!")
            
    def open_restaurant(self):
        print(self.name + "的" + self.type + "人气很高,而且年中无休!")
        
    def restaurant(self):
        print("到现在为止,已经有" + str(self.number_served) + "人在这家餐厅就餐过。")
        
    def set_number_served(self , num):
        self.number_served = num
        
    def increment_number_served(self , big):
        self.number_served += big 
        
class IceCreamStand(Restaurant):
    
    def __init__(self , restaurant_name , cuisine_type,*flavors):
        super().__init__(restaurant_name , cuisine_type)
        self.flavors = flavors
        
    def kouwei(self):
        print("我喜欢的冰激凌口味是:")
        for a in self.flavors:
            print(a)

my_ice = IceCreamStand('小猫' , '冰激凌店' , '黄桃' , '苹果' , '橘子' , '香蕉' , '菠萝')
my_ice.kouwei()
发布了98 篇原创文章 · 获赞 0 · 访问量 575
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 游动-白 设计师: 上身试试

分享到微信朋友圈

×

扫一扫,手机浏览