What the f*ck Python

分享一个有趣的库。

收集了Python语言中一些意想不到的例子。

比如:

some_dict = {}
some_dict[5.5] = "Ruby"
some_dict[5.0] = "JavaScript"
some_dict[5] = "Python"

output

>>> some_dict[5.5]
"Ruby"
>>> some_dict[5.0]
"Python"
>>> some_dict[5]
"Python"

"Python" destroyed the existence of "JavaScript"?

0 comments