I get this inb the Python interpreter v. 2.3
[color=blue][color=green][color=darkred]
>>>
>>> X=99
>>> X is 99[/color][/color][/color]
True[color=blue][color=green][color=darkred]
>>> Y=100
>>> Y is 100[/color][/color][/color]
False[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
Numbers less that 100 get True, more than 100 get False. It seems. What does
this mean? If nothing, then why does it happen? I mean how do you explain
'is' or 'id(X)' to the first time programmer when it does this to you.
Peter
[color=blue][color=green][color=darkred]
>>>
>>> X=99
>>> X is 99[/color][/color][/color]
True[color=blue][color=green][color=darkred]
>>> Y=100
>>> Y is 100[/color][/color][/color]
False[color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
Numbers less that 100 get True, more than 100 get False. It seems. What does
this mean? If nothing, then why does it happen? I mean how do you explain
'is' or 'id(X)' to the first time programmer when it does this to you.
Peter
Comment