Python Newbie

Ethan Furman ethan at stoneleaf.us
Sun Feb 24 19:33:37 EST 2013


On 02/24/2013 04:08 PM, piterrr.dolinski at gmail.com wrote:
>> For example (I believe it's already been mentioned) "declaring" intX with some integer value does *nothing* to maintain
>>
>> X as an integer:
>>
>> --> intX = 32
>>
>> --> intX = intX / 3.0
>>
>> --> intX
>>
>> 10.6666666666
>>
>
> Yes I did see that it is possible to redefine the type of a variable.

And that right there is one of the key aspects of Python:  there are no variables, only objects, and objects' types 
cannot be changed.  objects can be labeled with names, but the names are more like sticky notes, and can be peeled off 
and stuck on some other object.

--
~Ethan~



More information about the Python-list mailing list