Variables

Richard Blackwood richardblackwood at cloudthunder.com
Sun Apr 24 00:14:16 EDT 2005


Dan Bishop wrote:

>Richard Blackwood wrote:
>  
>
>>Steven Bethard wrote:
>>
>>    
>>
>>>Richard Blackwood wrote:
>>>
>>>      
>>>
>>>>Indeed, this language is math. My friend says that foo is a
>>>>        
>>>>
>constant
>  
>
>>>>and necessarily not a variable. If I had written foo =
>>>>        
>>>>
>raw_input(),
>  
>
>>>>he would say that foo is a variable.
>>>>        
>>>>
>>>Then what does he say if you write:
>>>
>>>foo = 5
>>>foo = 6
>>>      
>>>
>...
>  
>
>>He says that foo is a constant. At first it was a constant which
>>    
>>
>equaled
>  
>
>>5, then it was a constant that equaled 6.
>>    
>>
>
>He must have a very unusual definition of "constant".
>
>  
>
I believe he argues that foo existed as two separate constants. He also 
says that if I write:

foo = 6
foo = raw_input()

then foo first exists as a constant and then as a variable (because it 
can then be anything, any value that the user inputs).



More information about the Python-list mailing list