元组 元组 1 # 2 # @author:浊浪 3 # @version:0.1 4 # @time: 2021/3/14 9:22 5 # 元组 6 '''可变序列和不可变序列''' 7 8 # 可变序列 列表, 字典 9 lst = [100, 522, 45] 10 print(id(lst ...
分类:
编程语言 时间:
2021-03-16 11:46:37
阅读次数:
0
Given a string s and a list of strings dict, you need to add a closed pair of bold tag <b> and </b> to wrap the substrings in s that exist in dict. If ...
分类:
其他好文 时间:
2021-03-15 10:29:48
阅读次数:
0
有时候,需要接受任意数量的实参,但预先不知道传递给函数的会是什么样的信息。在这种情况下,可将函数编写成能够接受任意数量的键值对--调用语句提供了多少就接受多少。 1、 >>> def a(**x): ## 在形参前面添加双星,可以在实参中添加任意数量的关键字参数,两个*让python创建一个名为x的 ...
分类:
编程语言 时间:
2021-03-11 20:35:51
阅读次数:
0
一、基础数据类型 数值(int、float) 序列(list、str、tuple) 散列(set、dict) 可迭代对象(序列、散列) 二、命名元组 from collections import namedtuple student = namedtuple('Students', ('name' ...
分类:
其他好文 时间:
2021-03-10 13:26:57
阅读次数:
0
# 任何对象都有一个bool值,空值或0、FALSE值除外 print(bool(0)) #Fasle print(bool(1)) # True print(bool('a')) # True print(bool('')) print(bool(None)) print(bool(dict()) ...
分类:
其他好文 时间:
2021-03-10 12:57:17
阅读次数:
0
1.map map就是映射,俗称字典 1.定义 var 变量名 map[key]val = make(map[key]val) ex: var dict map[string]string = make(map[string]string) 增: dict["name"] = "lqw" 查: di ...
分类:
其他好文 时间:
2021-03-09 13:44:00
阅读次数:
0
一、参考 Suggesters Elasticsearch Suggester 详解 二、基本介绍 2.1 bing 示例 2.2 suggest 过程 三、ES 的 suggester 3.1 实现原理 将输入的文本分解为token, 然后在索引的字典中查找相似的 term 并且返回 3.2 4 ...
分类:
其他好文 时间:
2021-03-09 13:25:28
阅读次数:
0
// proxy [?prɑ?ksi] 代理 // // es5代理方式 // let obj = {} // let newVal = '' // Object.defineProperty(obj, 'name', { // 第一个变量名称当前对象 第二个为当前对象的属性值 // get() { ...
分类:
其他好文 时间:
2021-03-09 13:23:18
阅读次数:
0
题目链接:https://codeforces.com/contest/1493/problem/C 题意:给定字符串s 求一个字典序最小的字符串t 满足 t的字典序>=s 并且 其中出现的字母次数可以被k整除 思路:考虑枚举哪个位置变大, 再枚举变成哪一个字母 然后利用前缀和 找前面的有多少个需要 ...
分类:
其他好文 时间:
2021-03-08 14:05:28
阅读次数:
0
1、在项目的settings.py文件中的REST_FRAMEWORK 字典修改DRF配置信息 # 修改DRF配置信息 REST_FRAMEWORK = { ...# d.指定后端使用的渲染器 # 会自动根据请求头中的Accept字段来,返回前端需要的数据格式 # 请求头中默认如果未添加Accept ...
分类:
编程语言 时间:
2021-03-05 12:54:09
阅读次数:
0