这是做一个银行储蓄的代码
card1="1001"
pwd1="123456"
ban1=10000
card2="1002"
pwd1="123456"
ban1=10000
card3="1003"
pwd1="123456"
ban1=10000
while True:
print("欢迎来到python银行!")
times=0
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":
inn=float(input("请输入存款金额:"))
if inn<=0:
print("存款金额请大于0!")
elif:#这里elif前总显示波浪线,不知道怎么改。提示语法错误
ban=ban+inn
print("存款成功!存入:",inn,"余额:",ban)
elif num=="2"
out=float(input("请输入取款金额:"))
if out>ban:
print("余额不足,赶紧去赚钱!")
continue
else:
ban=ban-out
print("取款成功!取出:",out,"余额:",)
elif num=="3"
print("请收好卡片,欢迎下次再来!")
break
else:
print("输入有误!")
continue
#File "C:\Users\baili\Desktop\test1.py", line 40
elif:
^
SyntaxError: invalid syntax
[Finished in 113ms]
card1="1001"
pwd1="123456"
ban1=10000
card2="1002"
pwd1="123456"
ban1=10000
card3="1003"
pwd1="123456"
ban1=10000
while True:
print("欢迎来到python银行!")
times=0
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":
inn=float(input("请输入存款金额:"))
if inn<=0:
print("存款金额请大于0!")
elif:#这里elif前总显示波浪线,不知道怎么改。提示语法错误
ban=ban+inn
print("存款成功!存入:",inn,"余额:",ban)
elif num=="2"
out=float(input("请输入取款金额:"))
if out>ban:
print("余额不足,赶紧去赚钱!")
continue
else:
ban=ban-out
print("取款成功!取出:",out,"余额:",)
elif num=="3"
print("请收好卡片,欢迎下次再来!")
break
else:
print("输入有误!")
continue
#File "C:\Users\baili\Desktop\test1.py", line 40
elif:
^
SyntaxError: invalid syntax
[Finished in 113ms]