problem with the if statement and elif

Sean 'Shaleh' Perry shalehperry at attbi.com
Sat Jan 18 03:31:28 EST 2003


On Friday 17 January 2003 23:25, CIouded 0ne wrote:
> hey i have a question i look at the tutorials that come for download with
> the python interpreter and whatnot and i can never get the if and elif to
> work for? is there a trick to it even though i copy it straight from the
> tutorial? im assuming i even downloaded a bad file or im doing it wrong and
> the tutorial is wrong but i dont think  i downloaded a bad file because
> this happened to me on all versions of the python interpreter. so any words
> of advice to help me out would be appreciated thanx.

>>> if 1 == 2:
...   print "math is broken"
... elif 1 == 1:
...   print "math still works"
... else:
...   print "how did I get here?"
... 
math still works

that is straight from the interactive interpreter.

Perhaps you could share some code that does not work for you?





More information about the Python-list mailing list