An interesting beginner question: why we need colon at all in the python language?

Thorsten Kampe thorsten at thorstenkampe.de
Wed Jul 13 03:36:39 EDT 2011


* Dave Angel (Mon, 11 Jul 2011 10:36:48 -0400)
> On 01/-10/-28163 02:59 PM, Anthony Kong wrote:
> > My immediate response is: it allows us to fit statements into one
> > line. e.g.
> > if a == 1: print a
> >
> You're confusing the colon with the semi-colon. If you want two
> statements on the same line, you use a semi-colon.

He's not confusing anything at all. His example made it pretty clear 
that he didn't mean "two statements" but "multiline statemements".

Thorsten



More information about the Python-list mailing list