from restaurant import Restaurant, IceCreamStand my_restaurant = Restaurant('海底捞', '火锅') my_restaurant.set_number_served(600000) first_IceCreamStand = IceCreamStand('哈根达斯', '冰淇淋') first_IceCreamStand.flavors = ['比利时巧克力', '蓝莓口味', '抹茶口味'] first_IceCreamStand.show_flavors() second_IceCreamStand = IceCreamStand('DQ', '冰淇淋') second_IceCreamStand.flavors = ['奥利奥', '蒙布朗栗子', '樱桃口味'] second_IceCreamStand.show_flavors()
from restaurant import IceCreamStand, Restaurants richies = IceCreamStand(name='richies', cuisine_type='ice cream stand') richies.flavors = ['chocolate', 'vanilla', 'tart', 'cookies & cream'] richies.menu() richies.set_served(46) richies.increment_served(-98) richies.customers()
#! python3 print("Task 9.10") from restaurant import Restaurant, IceCreamStand ice = IceCreamStand('Ice World') ice.flavors = ['banana', 'vanilla', 'chocolate'] ice.describe_restaurant() ice.describe_flavors() print("Task 9.11") from users import Admin adrian = Admin('adrian', 'szymanski', 'zeus', '*****@*****.**', 'adrian88szymanski', 'sport', 'poland') adrian.describe_user() adrian.privileges.show_privileges() print("\nAdding privileges...") adrian_privileges = [ 'can add posts', 'can remove posts', 'can suspend accounts', ] adrian.privileges.privileges = adrian_privileges adrian.privileges.show_privileges()
from restaurant import Restaurant, IceCreamStand #创建Restaurant 实例 r1 = Restaurant('食堂', '各种餐点') r1.set_number_served(30) #创建IceCreamStand实例 r2 = IceCreamStand('ABC', 'icecream') r2.flavors = ['chocolate', 'cream', 'vanilia'] r2.show_the_flavor_of_the_icecreamstand() r3 = IceCreamStand('DEF', 'icecream') r3.flavors = ['chocolate', 'lemon', 'cream'] r3.show_the_flavor_of_the_icecreamstand()
from restaurant import Restaurant restaurant1=Restaurant('KFC','fast food') restaurant1.number_served=100 restaurant1.describe_restaurant() restaurant1.set_number_served() from restaurant import IceCreamStand icecreamstand1=IceCreamStand('Ice Queen','icecream') icecreamstand1.describe_restaurant() icecreamstand1.flavors=['milk','chocolate'] icecreamstand1.describe_flavor() icecreamstand2=IceCreamStand('Ice House','icecream') icecreamstand2.describe_restaurant() icecreamstand2.flavors=['lemon'] icecreamstand2.describe_flavor()