Problem I have with a while loop/boolean/or

israphelr at googlemail.com israphelr at googlemail.com
Tue Mar 13 18:52:02 EDT 2007


On Mar 13, 10:43 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> "israph... at googlemail.com" <israph... at googlemail.com> writes:
> > while (hint != 'n') or (hint != 'y'):
> >     hint = raw_input("Please specify a valid choice: ")
>
> > ---------------------------------------------
>
> > so everytime I run the program, and enter my choice as y or n, I'm
> > told to 'Please Specify a valid Choice Again' and can't get out of the
> > loop.
>
> Suppose your hint is 'y'.  Ask yourself these two questions:
>
>   1. Is (hint != 'n') true?
>   2. Is (hint != 'y') true?
>
> Now ask yourself what the condition in your while loop says.

Thanks.

*puts my head under a white sheet* =/





More information about the Python-list mailing list