python之路之商城购物车
1.程序说明:Readme.txt
1.程序文件:storeapp_new.py userinfo.py 2.程序文件说明:storeapp_new.py-主程序 userinfo.py-存放字典数据 3.python版本:python-3.5.3 4.程序使用:将storeapp_new.py和userinfo.py放到同一目录下, python storeapp_new.py 5.程序解析: (1)允许用户注册登陆认证 (2)允许用户初始化自己拥有的金钱 (3)允许用户使用序号购买商品 (4)用户结束购买时自动结算余额及打印这次购买的商品列表 (5)允许用户再次登陆并打印历史购买商品列表及余额 (6)允许用户再次购买商品,直到余额小于选择的商品价格 (7)不允许退货,购买前请三思和掂量一下自己的钱包 6.程序执行结果:请亲自动手执行或者查看我的博客 7.程序博客地址:http://www.cnblogs.com/chenjw-note/p/7724580.html 8.优化打印输出效果
2.程序代码:storeapp_new.py
#!/usr/bin/env python # _*_ coding: utf-8 _*_ # author:chenjianwen # email:1071179133@qq.com # update_time:2017-10-17 19:47 # blog_address:www.cnblogs.com/chenjw-note # If this runs wrong, don't ask me, I don't know why; # If this runs right, thank god, and I don't know why. # Maybe the answer, my friend, is blowing in the wind. def print_red(messages): print('