Python's Syntax

David Russell webmaster at greich.co.uk
Fri Mar 1 00:01:53 EST 2002


Hi,

I can't get my head around Python's syntax for the if, for, while etc.
statements.

I'm used to the classic:

if (condition == TRUE)
    {
        Do this
     }
else
    {
        Do this
    }

I've had a look at a couple of tutorials for Python and it appears like
this:

if condition == TRUE:
    do this


How do you tell it when to stop? I just can't figure out how to do it. Could
somebody explain it to me please, even though I have a strange suspicious
that it is one of the simplest deatils imaginable.

Also, another thing about Python's syntax. Are statements just sperated by
their lines, or do they have some form of seperator (like a semi-colon)?


Thanks for any help, it is appreciated.

(Sorry if this appears twice, the first time I sent it I got an error so I'm
not sure if both will show up)








More information about the Python-list mailing list