Python's Syntax

Sean 'Shaleh' Perry shalehperry at attbi.com
Fri Mar 1 12:19:52 EST 2002


> 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)?
> 

read some more on http://www.python.org.  Python is whitespace delimited.  Your
if statement above knew when to stop because you stopped indenting.

if test:
  do()
  something()
  here()
else:
  maybe()
  other()
  thing()

more()

Most of us who like coding in python appreciate this syntax because it makes
for easier rapid development.  No worrying about braces, semi-colons, etc.  I
just type and and type and it works.  This also gets rid of the dangling else
issue in languages like C.  Takes some getting used to, but if it works for
you, using another language feels odd.




More information about the Python-list mailing list