Loop problem while generating a new value with random.randint()

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Mon Feb 15 11:30:29 EST 2010


Jean-Michel Pichavant a écrit :
> Paulo Repreza wrote:
>> Greetings,
>>
>> I'm having problems with a little script that I'm trying to finish, I 
>> don't know if I'm in the right track but I know somebody is going to 
>> help me.

(snip - problem already addressed by Jean-Michel...)

>> while var != ranum:
>>     if var == ranum:

Note that this branch will never be executed - the condition in the 
while statement make sure var != ranum in the while block.

>>         print var, 'equals to:', ranum
>>     else:
>>         print var, 'does not equal to:', ranum
>>



More information about the Python-list mailing list