![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python日常
penspencap
penspencap
展开
-
python 列表相等(非顺序)
在写单元测试的时候, 测db里面获取到的值, 发现res = load_data_from_db(data = [{'a': 2}, {'a': 1}])assert [{'a': 1}, {'a': 2}]==res居然报错了!!!在度娘里面找不到, 关于非排序的列表判断相等的相关的知识谷歌一下, Raymond大神给出了正解如果对于可哈希的值使用 Counter() ,O(n): def co...转载 2018-04-04 07:58:42 · 4277 阅读 · 0 评论 -
偶尔会用到的知识
format问题# 想要输出大括号f = '{{{}}}'.format('123')assert f == '{123}'原创 2018-05-16 15:13:16 · 171 阅读 · 0 评论