设为首页 加入收藏

TOP

淘淘购物系统 (Python)(二)
2019-09-14 00:55:50 】 浏览:91
Tags:淘淘 购物 系统 Python
end(shopping[choice])
space.append(1)
sprice.append(space)
print('购买成功,已添加购物车!')
while len(sprice) > 1 :
if sprice[-1][0] in sprice[0:-1][0]:
del sprice[-1]
else:
break
else:
mess.append(shopping)
shopping = shopping[choice]
if choice == 'e':
break
if choice == 'b':
shopping = mess[-1]
del mess[-1]

#main0方法 #购物模块
def main0 ():
while 1:
tao_first()
t5 = input('你输入你要选择的功能<<<')
if t5 == '注册':
enter()
elif t5 == '登陆':
login()
break
elif t5 == '退出':
exit()
message()

money = 0 # 金钱【账单总值】
wage = [] #工资
#main1方法
def main1():
global money
while 1:
tao_second()
ma1 = input('你选择服务<<<')
if ma1== '提交订单':
for i in range(len(sprice)):
money = sprice[i][1] * sprice[i][2]
second2 = '|| 购物车订单 ||'.center(125)
print(second2)
print()
print('=' * 130)
print('商品名称', end='\t')
print('价格', end='\t')
print('数量', end='\t')
print('\n')
for i in sprice:
print(i)
print('-' * 130)
print('您本次需要支付'+str(money)+'人民币') staff_wage()

if ma1 == '删除订单': add_mal2 =
input('请输入你要删除的商品名称:') add_mal3 =
input('请输入你要删除该商品名称的个数:')
for tom in range(len(sprice)):
if add_mal2 in sprice[tom][0]:
if int(add_mal3) >= sprice[tom][2] :
del sprice[tom]
else: sprice[tom][
2] = sprice[tom][2] - int(add_mal3)
if ma1 == '添加订单': add_mal0 =
input('请输入你要添加的商品名称:') add_mal1 =
input('请输入你要添加该商品名称的个数:')
for tom in range(len(sprice)):
if add_mal0 in sprice[tom][0]: sprice[tom][
2] = sprice[tom][2] + int(add_mal1)
print('订单添加成功!')
if ma1 == '查看订单': second1 =
'|| 购物车订单 ||'.center(125)
print(second1)
print()
print('=' * 130)
print('商品名称', end='\t')
print('价格', end='\t')
print('数量', end='\t')
print('\n')
for i in sprice:
print(i)
print('-' * 130)
if ma1 == '继续购物': message()

if ma1 == '退出系统':
exit()


#main方法
def main(): main0() main1()main()





首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇【第八篇】Python的文件(file)操作 下一篇Python学习日记(二十五) 接口类、..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目