sum=0gouwuche=""shuliang=0notebook={ "本子":3,"小本子":2,"大本子":5}pen={ "签字笔":5,"圆珠笔":3,"铅笔":2}id=""pwd=""name={}sex={}integral="0"vip=""a=input("请输入”1”创建账号:")if a=="1": name=input("请输入姓名:") sex=input("请输入性别:") id=input("请输入账号:") pwd=input("请输入密码:") print("注册成功,请登入账号") while True: id=input("请输入账号:") pwd=input("请输入密码:") if id==id and pwd==pwd: print("欢迎尊敬的"+name+"进入商店") print("个人信息:") print("普通会员") print("姓名:"+name) print("性别:"+sex) while True: a=input("输入商品类型:“本子”或“笔”,输入”BUY“结算:") if a == "本子": print("1. 本子 3元") print("2. 小本子 2元") print("3. 大本子 5元") while True: a=input("输入编号购买商品,输入“B”返回类型选择:") if a=="1": geshu=int(input("输入购买个数:")) gouwuche+="本子" gouwuche+="*" gouwuche+=str(geshu) gouwuche+=" " sum+=int(notebook["本子"])*geshu shuliang1=str(geshu) print("加入购物车成功") elif a=="2": geshu=int(input("输入购买个数:")) gouwuche+="小本子" gouwuche+="*" gouwuche+=str(geshu) gouwuche+=" " sum+=int(notebook["小本子"])*geshu shuliang2=str(geshu) print("加入购物车成功") elif a=="3": geshu=int(input("输入购买个数:")) gouwuche+="大本子" gouwuche+="*" gouwuche+=str(geshu) gouwuche+=" " sum+=int(notebook["大本子"])*geshu print("加入购物车成功") else: break if a == "笔": print("1. 签字笔 5元") print("2. 圆珠笔 4元") print("3. 铅笔 2元") while True: a=input("输入编号购买商品,输入“B”返回类型选择:") if a=="1": geshu=int(input("输入购买个数:")) gouwuche+="签字笔" gouwuche+="*" gouwuche+=str(geshu) gouwuche+=" " sum+=int(pen["签字笔"])*geshu shuliang1=str(geshu) print("加入购物车成功") elif a=="2": geshu=int(input("输入购买个数:")) gouwuche+="圆珠笔" gouwuche+="*" gouwuche+=str(geshu) gouwuche+=" " sum+=int(pen["圆珠笔"])*geshu shuliang2=str(geshu) print("加入购物车成功") elif a=="3": geshu=int(input("输入购买个数:")) gouwuche+="铅笔" gouwuche+="*" gouwuche+=str(geshu) gouwuche+=" " sum+=int(pen["铅笔"])*geshu print("加入购物车成功") else: break elif a=="BUY": jifen=str(sum/2) print("您购买的商品有:") print(gouwuche) print("您共有"+integral+"积分") print(str(sum)+"元") if float(integral)>=0.0 and float(integral)<=100.0: vip="普通会员" if float(integral)>100.0 and float(integral)<=200.0: vip="高级会员" elif float(integral)>200.0 and float(integral)<=350.0: vip="银钻会员" elif float(integral)>500.0: vip="金钻会员" aa=input("输入“2”查看个人信息:") if aa=="2": print("个人信息:") print(vip) print("姓名:"+name) print("性别:"+sex) else: print("输入错误") else: print("输入账号或密码有误,请重新输入")