# -*- coding: utf-8 -*-
import time
# 展品展示
goods_list = [
{"name": "电脑", 'price': 1999, "num": 20, "sum": "有现货"},
{"name": "鼠标", 'price': 10, "num": 20, "sum": "有现货"},
{"name": "游艇", 'price': 20, "num": 20, "sum": "有现货"},
{"name": "美女", 'price': 998, "num": 20, "sum": "有现货"},
{"name": "油精", 'price': 30, "num": 20, "sum": "有现货"}
]
# 添加购物车用
my_car = {
1: {"name": "电脑", 'price': 1999, "num1": 0, "sum": "有现货"},
2: {"name": "鼠标", 'price': 10, "num1": 0, "sum": "有现货"},
3: {"name": "游艇", 'price': 20, "num1": 0, "sum": "有现货"},
4: {"name": "美女", 'price': 998, "num1": 0, "sum": "有现货"},
5: {"name": "油精", 'price': 30, "num1": 0, "sum": "有现货"}
}
# 充值金额函数体
chu_money = 0 # 初始化金额
def chongzhi():
global chu_money
tag = True
while tag:
money = input("请输入您要充值的金额").strip()
if money.isdigit(): # isdigit(判断是否由数字组成)
money = int(money)
chu_money += money
print("充值成功,您当前的余额为{}".format(chu_money))
break
else:
print("充值失败,请正确输入金额数字")
# 展品展示
def shwo_shangpin():
print("===========================================&#