Commit f5b3f88b by BellCodeEditor

save project

parent b428a128
username = "霍鼎文"
userpassword="17988"
i=0
while True:
if i<=3
name=input("请输入用户名:")
password=input("请输入密码:")
i+=1
if username==name and password==userpassword:
print("登录成功!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
break
if name != username:
print("用户名错误")
continue
if password != userpassword:
print("用户密码错误")
elif :
print("去自首吧")
exit()
print("欢迎来到贝尔!")
print("-----------------------------")
print("-----------------------------")
print("| |")
print("|---------------------------|")
print("|1.可乐 3元 | * * ")
print("|2.雪碧 3.5元 | ------")
print("|3.糖果 0.5元 | | 投 |")
print("|4.袜子 10元 | | 币 |")
print("|5.奥特曼 100元 | | 口 |")
print("|6.面包 5元 | ------")
print("| |")
print("|---------------------------|")
print("| |")
print("| 取货口 |")
print("| +----------------+ |")
print("| +----------------+ |")
print("| +----------------+ |")
print("| |")
print("|---------------------------|")
qian =int(input("请投入您的货币:"))
bianhao =int(input("请投入您需要购买的商品编号:"))
shuliang =int(input("请输入您需要购买的商品数量:"))
if bianhao == 1:
jiage = 3
print('购买可乐')
elif bianhao == 2:
jiage = 3.5
print('购买雪碧')
elif bianhao == 3:
jiage = 0.5
print('购买糖果')
elif bianhao == 4:
jiage = 10
print('购买袜子')
elif bianhao == 5:
jiage = 100
print('购买奥特曼')
elif bianhao == 6:
jiage = 5
print('购买面包')
else:
jiage = 0
print("请输入正确的价格")
if qian < jiage * shuliang:
print('金额不足')
print('返还',qian)
else:
print("购买 成功")
print('返回',qian - jiage * shuliang)
++ "b/\350\257\276\344\273\266/02.py"
++ "b/\350\257\276\344\273\266/03.py"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment