def ydrz(): print("引导入座") def dcd(): print("递菜单") def dc(): print("点餐") def gscscd(): print("告诉厨师菜谱") def zc(): print("做菜") def yc(): print("用餐") def jscf(): print("计算餐费") def zfcf(): print("支付餐费") def sqcf(): print("收取餐费") ydrz() dcd() dc() gscscd() zc() yc() jscf() zfcf() sqcf()
class Waiter(): def ydrz(self): print("引导入座") def dcd(self): print("递菜单") def gscscd(self): print("告诉厨师菜谱") class Customer(): def dc(self): print("点餐") def yc(self): print("用餐") def zfcf(self): print("支付餐费") class Cook(): def zc(self): print("做菜") class Cashier(): def jscf(self): print("计算餐费") def sqcf(self): print("收取餐费") zhangsan=Customer() xiaoming=Waiter() laowang=Cook() xiaohong=Cashier() xiaoming.ydrz() xiaoming.dcd() zhangsan.dc() xiaoming.gscscd() laowang.zc() zhangsan.yc() xiaohong.jscf() zhangsan.zfcf() xiaohong.sqcf()
标签:ydrz,python,self,餐费,zc,面向对象,print,def From: https://www.cnblogs.com/szmtjs10/p/18219447