Nested if's

GeoJempty geojempty at aol.com
Fri Oct 15 11:20:51 EDT 1999


I'm brand new to Python, though I chose it for my CGI programming because of
it's similarity to the language I use at my day-job: the Progress 4GL

Enough for intros.  I'm having a problem nesting if statements.  I'm defining a
function, and my syntax checks fine, until I try the following:

if digit > 0:
  if digit = 5:
    variable = variable + whatever

In the context of a CGI program this causes an Internal server error,
"premature end of script headers".  I encountered this before when I forgot the
colon after my if statement, but I don't understand it here -- the only
processing I intend to do if digit > 0 are further conditional tests.

Thanks in advance for your help.  If that just means that you will point me to
the appropriate place in the online documentation, that will be appreciated (I
own both Learning and Programming Python)




More information about the Python-list mailing list