While loop with "or"? Please help!

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Thu Jan 25 10:33:36 EST 2007


wittempj at hotmail.com a écrit :
> 
> On Jan 25, 11:26 am, wd.jons... at gmail.com wrote:
(snip)
>> #Runs the buildfinder function
>> usrinp = buildfinder()
>>
>> def buildwhiler():
>>
>>     while usrinp != "y" or "Y" or "N" or "n": <<<<----PROBLEM
>>         print "Enter Y or N!"
>>         usr = str(raw_input('Y/N: '))
>>     else:
>>         code continues
> 
> also note that your naming of variables contains two different names
> for one variable...

Actually, usrinp and usr are really two different vars - the first one 
being global...

And FWIW, it's one of the "other errors" I mentionned earlier <g>




More information about the Python-list mailing list