Total Views:
python 数据类型
和绝大多数的文件或编程语言一样
基础的: num str None 复杂的: list, dict, set
python 函数中, 参数的定义顺序
|
|
python 类知识点
|
|
repr !r的用法
|
|
多行import, 换行
|
|
except
|
|
unpack
|
|
多list
|
|
其他常用 - collection. - Counter() - 统计个数神器 - most_comon() - pop - update - deque() - 双端队列 - 1 - append() - appendleft() - 2 - popleft() - pop() - clear() - namedtuple - 创建一个结构体的东西 - 不可修改 - 简单数据 - 方法 - 创建 - _make() - _replace() - 返回新实例 - 查看 - _asdict() - 返回字典 - _fields - 所有字段 - orderdict() - defaultdict(lambda:“none”) - 为不存在的 key 设置默认值 - itertools. - 排列组合 - 排列 - permutations() - 不放回,元素不重复 - product() - 多组 - 组合 - combinations - 不放回,元素不重复 - combinations_with_replacement() - 多组 - 1 - 使用 for - 使用 list() - repeat() - cycle() - dataclass - 可以修改 - 较复杂数据