![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 62
聪少少灬
欲戴皇冠,必承其重!
展开
-
面试系列之Python基础
python知识点原创 2022-07-26 14:45:31 · 425 阅读 · 1 评论 -
collections模块之其他数据结构
1. 计数器 可以使用 Counter(seq) 对序列中出现的元素个数进行统计。 例如,我们可以统计一段文本中出现的单词及其出现的次数: from string import punctuation sentence = "One, two, three, one, two, tree, I come from China." words_count = collections.Counter(sentence.translate(punctuation).lower().split()) print原创 2021-03-12 15:34:17 · 118 阅读 · 0 评论 -
数据结构----python实现数组
from array import array # python 提供的比较原始的 array 类 arr = array('u', 'asdf') print(arr[0], arr[1], arr[2], arr[3]) print(type([None] * 32)) class Array(object): def __init__(self, size): self._size = size self._items = [None] * 32 .原创 2020-09-08 15:08:13 · 189 阅读 · 0 评论