![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python数据结构
文章平均质量分 66
北TuT
这个作者很懒,什么都没留下…
展开
-
Python内置类型性能分析
集合(list)操作def test1(): l = [] for i in range(1000): l = l + [i]def test2(): l = [] for i in range(1000): l.append(i)def test3(): l = [i for i in range(1000)]def test4(): l = list(range(1000))def test5():原创 2021-07-11 18:43:18 · 97 阅读 · 0 评论 -
Python数据结构之算法的引入
算法的引入引入:如果 a+b+c=1000,且 a2 + b2=c2(a,b,c 为自然数),如何求出所有a、b、c可能的组合?import timestart_time = time.time()for a in range(0, 1001): for b in range(0, 1001): for c in range(0, 1001): if a**2 + b**2 == c**2 and a+b+c == 1000:转载 2021-07-11 13:11:39 · 218 阅读 · 0 评论