Skip to content

Python Memes

HOA PHAN edited this page Mar 7, 2024 · 3 revisions
python3 -c "import platform; print(platform.python_implementation())"

CPython


>>> a=256
>>> b=256
>>> a is b
True
>>> x=257
>>> y=257
>>> x is y
False

>>> l =[{}]*2
>>> l
[{}, {}]
>>> l[0]['a']='x'
>>> l[1]['b']='y'
>>> l
[{'a': 'x', 'b': 'y'}, {'a': 'x', 'b': 'y'}]

https://peps.python.org/pep-0703/

eye

Clone this wiki locally