
python
文章平均质量分 65
shitfly
啥也不会
展开
-
codewars day1
1.Find The Parity Outlier Description:You probably know the “like” system from Facebook and other pages. People can “like” blog posts, pictures or other items. We want to create the text that should b原创 2017-04-20 13:19:54 · 447 阅读 · 0 评论 -
leetcode day1
LeetCode 557. Reverse Words in a String IIIGiven a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:原创 2017-04-21 16:38:32 · 263 阅读 · 0 评论 -
python2中为什么while 1比while True快
使用dis模块的dis()可以显示函数的字节码,它的参数可以是函数对象或者代码对象。 如果是函数对象>>> dis.dis(myfunc) 2 0 LOAD_GLOBAL 0 (len) 3 LOAD_FAST 0 (alist) 6 CALL_FUNCTION原创 2017-08-09 17:24:32 · 1460 阅读 · 0 评论 -
Python字典对象实现原理
原文链接 字典类型是Python中最常用的数据类型之一,它是一个键值对的集合,字典通过键来索引,关联到相对的值,理论上它的查询复杂度是 O(1) :>>> d = {'a': 1, 'b': 2}>>> d['c'] = 3>>> d{'a': 1, 'b': 2, 'c': 3}在字符串的实现原理文章中,曾经出现过字典对象用于intern操作,那么字典的内部结构是怎样的呢?PyDictOb转载 2017-08-10 21:10:11 · 375 阅读 · 0 评论