[Tutor] Re: Tutor digest, Vol 1 #281 - 7 msgs

Daniel Yoo dyoo@hkn.EECS.Berkeley.EDU
Tue, 4 Apr 2000 10:34:57 -0700 (PDT)


>     if goodstats == 'yes' or 'y':
> 	MakeStats()
>     elif goodstats == 'no' or 'n':

The way that python will probably group those lines is:

	if (goodstats == 'yes') or 'y':

and likewise with the third line.  Since 'y' is a true value (in Python),
the program's always going to call MakeStats().  To fix this, you probably
want to write

	if goodstats == 'yes' or goodstats == 'y'

The or expression needs to be wedged in between independent expressions,
so that's why the test against goodstats needs to be repeated.