标签:filter 购物 ice col div 管理员 put style rate
list=[ (‘book‘,20), (‘bike‘,2000), (‘shoes‘,300), (‘cars‘,200000), ] saving=input(‘put your saving money:‘) shoppingcar=[] if saving.isdigit(): saving=int(saving) while True: for i,v in enumerate(list,1): print(i,‘>>>‘,v) choice=input(‘choose the number of goods[quit:q]:‘) if choice.isdigit(): choice=int(choice) if choice>0 and choice<=len(list): item=list[choice-1] if item[1]<saving: saving-=item[1] shoppingcar.append(item) else: print(‘haiyouyue:%s‘%saving) print(item) elif choice==‘q‘: print(‘quit‘) for i in shoppingcar: print(i) print(‘haiyouyue:%s‘%saving)
1.购物车系统登录时验证用户名及密码;
2.用户联系管理员进行充值功能;
3.用户购物并打印详细购物列表;
4.用户账户及余额持久化到文件。
标签:filter 购物 ice col div 管理员 put style rate
原文地址:https://www.cnblogs.com/ernestli/p/9862241.html