sum=0
gouwuche=""
shuliang=0
dianzi={"手机":5000,"电脑":6000,"剃须刀":100}
baihuo={"手表":1000,"皮带":250,"皮鞋":2000}

userku=""
psdku=""
nameku={}
sexku={}
jifen="0"
vip=""

a=input("请输入”1”创建账号:")
if a=="1":
nameku=input("请输入姓名:")
sexku=input("请输入性别:")
userku=input("请输入账号:")
psdku=input("请输入密码:")
print("注册成功,请登入账号")
while True:
user=input("请输入账号:")
psd=input("请输入密码:")
if user==userku and psd==psdku:
print("欢迎尊敬的"+nameku+"进入商店")
print("个人信息:")
print("普通会员")
print("姓名:"+nameku)
print("性别:"+sexku)
while True:
a=input("输入商品类型:“电子”或“百货”,输入”BUY“结算:")
if a == "电子":
print("1. 手机 5000元")
print("2. 电脑 6000元")
print("3. 剃须刀 100元")
while True:
a=input("输入编号购买商品,输入“B”返回类型选择:")
if a=="1":
geshu=int(input("输入购买个数:"))
gouwuche+="手机"
gouwuche+="*"
gouwuche+=str(geshu)
gouwuche+=" "
sum+=int(gaodian["手机"])*geshu
shuliang1=str(geshu)
print("加入购物车成功")

elif a=="2":
geshu=int(input("输入购买个数:"))
gouwuche+="电脑"
gouwuche+="*"
gouwuche+=str(geshu)
gouwuche+=" "
sum+=int(gaodian["电脑"])*geshu
shuliang2=str(geshu)
print("加入购物车成功")

elif a=="3":
geshu=int(input("输入购买个数:"))
gouwuche+="剃须刀"
gouwuche+="*"
gouwuche+=str(geshu)
gouwuche+=" "
sum+=int(gaodian["剃须刀"])*geshu
print("加入购物车成功")

else:
break

if a == "百货":
print("1. 手表 1000元")
print("2. 皮带 250元")
print("3. 皮鞋 2000元")
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/linrun666/p/10942680.html

你可能感兴趣的:(续)