代码 # 商品属性 ITEM = {'ITEM0001': {'name': '黄焖鸡', 'price': 18}, 'ITEM0013': {'name': '肉夹馍', 'price': 6}, 'ITEM0022': {'name': '凉皮', 'price': 8} } # 打折商品列表 ...
分类:
其他好文 时间:
2020-02-28 01:40:12
阅读次数:
173
//常用操作: // 1.查看数据库 show dbs // 2.创建并使用数据库 use tst // 3.查看当前工作的数据库 db // 4.创建集合并插入一条数据 db.goods.insert({"name":"辣条", "price":0.5}) // 5.查看所有表 show tabl ...
分类:
数据库 时间:
2020-02-26 14:11:51
阅读次数:
76
# 怎样从一个集合中获得最大或者最小的 N 个元素列表? import heapq nums = (1, 8, 2, 23, 7, -4, 18, 23, 42, 37, 2) print(heapq.nlargest(1, nums)) # Prints [42, 37, 23] print(he ...
分类:
其他好文 时间:
2020-02-24 12:55:24
阅读次数:
71
核心:按照状态: 一开始持有金额:0 第一次买入:buy1 = 0-price[i] 第一次卖出:sol1 = buy1+price[i] 第二次买入:buy2 = sol1-price[i] 第二次卖出:sol2 = buy2+price[i] 由于从4->1向前依赖,所以对于每个i,赋值顺序应为 ...
分类:
其他好文 时间:
2020-02-23 14:51:57
阅读次数:
72
1 class Cashier: 2 def __init__(self, n: int, discount: int, products: 'List[int]', prices: 'List[int]'): 3 self.customer_num = 0 4 self.dic = {} 5 m ...
分类:
其他好文 时间:
2020-02-23 14:45:07
阅读次数:
66
This simple example raises a number of important points. First, the price is set by the buyer who is willing to pay the highest price. This price is n ...
分类:
其他好文 时间:
2020-02-23 11:53:35
阅读次数:
81
0. 前言 怎么上... 咳咳,大家别想歪,这是一篇纯技♂术文章。 0.1 Why TypeScript 什么?尤大要把Vue 3.0全部改成用Typescript来写?这不是逗我吗,那我是不是要用TypeScript来写Vue应用了? 好吧,Vue3.0可能最快也要19年年末才出来,Vue3.0是 ...
分类:
其他好文 时间:
2020-02-22 16:15:05
阅读次数:
124
import json#json串就是字符串d ={'car':{'color':'red','price':100,'count':50}, 'ff':{'color':'red','price':100,'count':50} }#res = json.dumps(d,indent=4,ensu ...
分类:
编程语言 时间:
2020-02-21 22:13:28
阅读次数:
89
01.代码如下: package TIANPAN; class Book { private String title; private double price; public Book(String title, double price) { this.title = title; this. ...
分类:
编程语言 时间:
2020-02-20 00:08:06
阅读次数:
73
```c++#include #include #include #include using namespace std;struct station { double per_price; double distance;};bool cmp(const station &s1, const s... ...
分类:
其他好文 时间:
2020-02-19 19:02:25
阅读次数:
81