2017年StackOverflow上最好的20个Python问题

1、Python的 .. (点号 点号) 是什么语法?

答案地址:https://stackoverflow.com/questions/43487811/what-is-python-dot-dot-notation-syntax

2、为什么在Python3中 x**4.0 比 x**4运行的快?

答案地址:https://stackoverflow.com/questions/42355194/why-is-x4-0-faster-than-x4-in-python-3

3、给定一个长度为100万的数字(比如π),写代码计算出所有连续的三个数字,且要求该连续的三个数字至少重复出现过一次。

答案地址:https://stackoverflow.com/questions/47581326/given-a-string-of-a-million-numbers-return-all-repeating-3-digit-numbers

4、为什么在Python中表达式 0, 0 == (0, False) 的结果是 (0, False)

答案地址:https://stackoverflow.com/questions/44864156/why-in-python-0-0-0-0-equals-0-false

5、Python会把一个只用做返回值的变量优化掉吗?

答案地址:https://stackoverflow.com/questions/43390869/does-python-optimize-away-a-variable-thats-only-used-as-a-return-value

6、加速Python3中百万次级的正则替换。

答案地址:https://stackoverflow.com/questions/42742810/speed-up-millions-of-regex-replacements-in-python-3

7、两个集合做并集,为什么会丢失集合中的元素?

答案地址:https://stackoverflow.com/questions/44489658/union-of-2-sets-does-not-contain-all-items

8、在for循环中,i = i + 1 和 i += 1有什么区别?

答案地址:https://stackoverflow.com/questions/41446833/what-is-the-difference-between-i-i-1-and-i-1-in-a-for-loop

9、为什么拷贝一个洗牌过的列表要慢很多?

答案地址:https://stackoverflow.com/questions/42107442/why-is-copying-a-shuffled-list-much-slower

10、为什么元组比列表消耗更少的内存?

答案地址:https://stackoverflow.com/questions/46664007/why-do-tuples-take-less-space-in-memory-than-lists

11、在Python中,当你用一个变量给另外一个变量赋值时,发生了什么?

答案地址:https://stackoverflow.com/questions/45053461/what-happens-when-you-assign-the-value-of-one-variable-to-another-variable-in-py

12、为什么这个Python字符串尝试转换为整数失败后,连大小都变了。

答案地址:https://stackoverflow.com/questions/47062184/why-does-the-size-of-this-python-string-change-on-a-failed-int-conversion

13、如何判断一个列表是否能被另一个列表整除?

答案地址:https://stackoverflow.com/questions/45906747/is-a-list-potentially-divisible-by-another

14、理解语句 *x ,= list。

答案地址:https://stackoverflow.com/questions/43190992/understanding-x-lst

15、为什么for循环中可以使用任意目标表达式?

答案地址:https://stackoverflow.com/questions/44317993/why-are-arbitrary-target-expressions-allowed-in-for-loops

16、更好的 Python for 循环方式。

答案地址:https://stackoverflow.com/questions/46996315/a-better-way-for-a-python-for-loop

17、Python and操作符的奇怪的使用方式。

答案地址:https://stackoverflow.com/questions/47007680/strange-use-of-pythons-and-operator

18、增加Python代码逻辑层数的上限个数。

答案地址:https://stackoverflow.com/questions/44972719/why-does-python-have-a-limit-on-the-number-of-static-blocks-that-can-be-nested

19、如何让一个dataframe围着中心旋转?

答案地址:https://stackoverflow.com/questions/47152691/how-to-pivot-a-dataframe

20、把一个变量赋值给自己,这有什么用?

答案地址:https://stackoverflow.com/questions/43853407/re-assigning-a-name-to-itself

转载自python程序员公众号

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值