else:
break
if a == "零食":
print("1. 泡面 2元")
print("2. 片片酥 4元")
print("3. 火腿肠 3元")
while True:
a=input("输入编号购买商品,输入“B”返回类型选择:")
if a=="1":
geshu=int(input("输入购买个数:"))
gouwuche+="泡面"
gouwuche+="*"
gouwuche+=str(geshu)
gouwuche+=" "
sum+=int(yinliao["泡面"])*geshu
shuliang1=str(geshu)
print("加入购物车成功")
elif a=="2":
geshu=int(input("输入购买个数:"))
gouwuche+="片片酥"
gouwuche+="*"
gouwuche+=str(geshu)
gouwuche+=" "
sum+=int(yinliao["片片酥"])*geshu
shuliang2=str(geshu)
print("加入购物车成功")
elif a=="3":
geshu=int(input("输入购买个数:"))
gouwuche+="火腿肠"
gouwuche+="*"
gouwuche+=str(geshu)
gouwuche+=" "
sum+=int(yinliao["火腿肠"])*geshu
print("加入购物车成功")
else:
break
elif a=="BUY":
jifen=str(sum/2)
print("您购买的商品有:")
print(gouwuche)
print("您共有"+jifen+"积分")
print(str(sum)+"元")
if float(jifen)>=0.0 and float(jifen)<=50.0:
vip="普通会员"
if float(jifen)>50.0 and float(jifen)<=150.0:
vip="高级会员"
elif float(jifen)>150.0 and float(jifen)<=200.0:
vip="银钻会员"
elif float(jifen)>200.0:
vip="金钻会员"
aa=input("输入“2”查看个人信息:")
if aa=="2":
print("个人信息:")
print(vip)
print("姓名:"+nameku)
print("性别:"+sexku)
else:
print("输入错误")
else:
print("输入账号或密码有误,请重新输入")
转载于:https://www.cnblogs.com/hzze/p/10942707.html