this is answered in the python faq: http://www.python.org/doc/faq/general.html#why-are-colons-required-for-the-if-while-def-class-statements > The colon is required primarily to enhance readability Chang LI wrote: > Some statements use : in the tail such as while x > 0: and def func(): > What is the meaning and the usage of : in Python?