# 卡号 card1="1001" pwd1="123456" ban1=10000 card2="1002" pwd2="123456" ban2=10000 card3="1003" pwd3="123456" ban3=10000 print("欢迎来到python银行!") times=0 while True: card=input("请输入银行卡号!") pwd=input("请输入密码:") ban=0 # 余额 if card==card1 and pwd==pwd1: ban=ban1 elif card==card2 and pwd==pwd2: ban=ban2 elif card==card3 and pwd==pwd3: ban=ban3 else: times=times+1 if times>=3: print("您已经3次输入错误,请联系银行柜台!") break else: print("卡号或者密码输入错误,请重新输入!") continue while True: num=input("请输入要办理的业务:1.存款 2.取款 3.退卡") if num=="1": inje=float(input("请输入存款金额")) if inje<=0: print("存款金额请大于0!"
python模拟银行自助取款
最新推荐文章于 2024-04-30 15:35:31 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)