摘要:
1,购物车小程序 需求: (1),启动程序后,打印全部商品列表,用户输入工资 (2),许用户根据商品编号购买商品 (3),用户购买商品,余额不足就退出程序,并打印信息 (4),可随时退出,退出时,打印已购买商品和余额 2,流程图 3,代码 4,测试 阅读全文
posted @ 2017-05-31 22:42
包八力
阅读(133)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python3#字典---增删改查#穿件一个字典info>>> info = {... 'student01':'TenLan Wu',... 'student02':'LongZe Luola',... 'student03':'XiaoZe Maliya'... ... } #字典查询 >>> inf... 阅读全文
posted @ 2017-05-31 17:38
包八力
阅读(162)
评论(0)
推荐(0)
摘要:
#!/usr/bin/python3#元组:元组是一个只读列表,也是村一组数,一旦创建,便不能在修改>>> tuple1 = ('cisco','huawei','vmware') >>> tuple1.count('cisco') #查看元素在元组中出现的次数1>>> tuple1.index('cisco') #查看元素在元组中的位置0>>> #string字符,字符串的操作不会改... 阅读全文
posted @ 2017-05-31 15:43
包八力
阅读(588)
评论(0)
推荐(0)