"""功能要求:要求用户输入自己拥有总资产,例如:2000显示商品列表,让用户根据序号选择商品,加入购物车购买,如果商品总额大于总资产,提示账户余额不足,否则,购买成功。goods = [ {"name": "电脑", "price": 1999}, {"name": "鼠标", "price": ...
分类:
编程语言 时间:
2018-07-08 20:04:53
阅读次数:
179
name = '小黑' FILE_NAME = 'goods.json' #常量 #局部变量 #在函数里面定义的变量都是局部变量,除了函数之后就不能用了 #全局变量 #在文件最上面定义的这个变量,就是全局变量 def hhh(): global name name='小白' # print(name... ...
分类:
其他好文 时间:
2018-07-07 23:05:15
阅读次数:
243
salary = input('please input your monthly salary: ') goods_list = [ ('iphone', 5000), ('mac pro', 12000), ('TV', 4500), ('pencel', 25) ] shopping_list... ...
分类:
其他好文 时间:
2018-07-07 20:44:56
阅读次数:
143
首先安装better-scroll 1 goods页面模板 js 注册方法 better-scroll用法 我们先来看一下 better-scroll 常见的 html 结构: 当 content 的高度不超过父容器的高度,是不能滚动的,而它一旦超过了父容器的高度,我们就可以滚动内容区了,这就是 b ...
分类:
其他好文 时间:
2018-07-04 01:08:34
阅读次数:
266
实体类1(商品): package mall.model; public class goods { private int shoppingID; // 商品编号 private String shoppingName;// 商品名 private int price; // 商品价格 publi ...
分类:
编程语言 时间:
2018-06-30 16:12:16
阅读次数:
160
#需求:1、添加商品 包括名称、价格数量2、查看商品信息3、删除、4、修改5退出6操作文件import jsonfile_name='goods.json'def opfile(name,content=None): if content: with open(name,'w',encoding=' ...
分类:
编程语言 时间:
2018-06-28 14:40:42
阅读次数:
357
python购物车程序数据结构: goods = [ {"name": "电脑", "price": 1999}, {"name": "鼠标", "price": 10}, {"name": "游艇", "price": 20}, {"name": "美女", "price": 998}, ....... ...
分类:
编程语言 时间:
2018-06-26 01:07:20
阅读次数:
202
var vm = new Vue({ el: "#app", data: { name: "苹果", price: 10, num: 1 }, components:{ "goods":goods } }); var goods = { template: "<div><p>名字:{{name}}< ...
分类:
其他好文 时间:
2018-06-23 15:42:55
阅读次数:
311
create table goods ( goods_id mediumint(8) unsigned primary key auto_increment, goods_name varchar(120) not null default '', cat_id smallint(5) unsign ...
分类:
数据库 时间:
2018-06-22 17:38:41
阅读次数:
171
move_upload_file()文件上传处理函数 header()和readfile()可以实现文件的下载 文件下载 <?php $textname='goods/test.txt';//原文件,需要下载的文件 $newname= 'index.txt';//新文件名,下载下来的文件名 head ...
分类:
Web程序 时间:
2018-06-16 17:56:24
阅读次数:
201