sum=0
gouwuche=""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("输入账号或密码有误,请重新输入")