[Tutor] Unable to get out of loop
Danny Yoo
danny.yoo at gmail.com
Fri Feb 26 21:19:22 EST 2016
On Feb 26, 2016 5:30 PM, "Ken G." <beachkidken at gmail.com> wrote:
>
> I have been unable to get out of the following
> loop. No matter what I entered, I can not get
> get out of the loop. The only way I can stop
> the routine is CTRL-C.
Yes: the condition on there code is unfortunately a tautology: it's always
going to be true.
For example, if side=0, although that fails the first sub-condition, it
succeeds in the other two, and because it uses the boolean 'or' operation,
the condition as a whole is successful. That's why the condition is always
going to be true.
Consider the difference between boolean 'or' and boolean 'and' instead.
More information about the Tutor
mailing list