http://foobarnbaz.com/2012/07/08/understanding-python-variables/


근데 이건 파이썬 특화 설명인 것 같음


But in Python variables work more like tags unlike the boxes you have seen before. When you do an assignment in Python, it tags the value with the variable name.

a = 1

and if you change the value of the varaible, it just changes the tag to the new value in memory. You dont need to do the housekeeping job of freeing the memory here. Python's Automatic Garbage Collection does it for you. When a value is without names/tags it is automatically removed from memory.

a = 2

 

Assigning one variable to another makes a new tag bound to the same value as show below.

b = a

Other languages have 'variables'. Python has 'names'.