How to code a series of alternatives
Paul Rubin
http
Mon Feb 23 17:34:01 EST 2004
More information about the Python-list mailing list
Mon Feb 23 17:34:01 EST 2004
- Previous message (by thread): How to code a series of alternatives
- Next message (by thread): Case sensitive file names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Scott F <sdfATexpertuneDOTcom> writes:
> testvar = bob
>
> # Trial A: This does not work
> if testvar == ("fred" or "bob):
> statements
>
> # Trial B: This does work
> if textvar == "fred" or textvar == "bob":
> statements
>
> Trial B is OK for 1 or 2 tests, but gets messy for 5 or 6. What is the
> variation of Trial A that will work?
if testvar in ("fred","bob"):
statements
- Previous message (by thread): How to code a series of alternatives
- Next message (by thread): Case sensitive file names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list