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

Anthony Kong anthony.hw.kong at gmail.com
Wed Jul 13 12:40:40 CEST 2011


Thanks, mate! I was writing that up really late at night. Somehow I changed
term to semi-colon half way through,

Cheers

On Wed, Jul 13, 2011 at 5:36 PM, Thorsten Kampe
<thorsten at thorstenkampe.de>wrote:

> * 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
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 

Tony Kong
*blog:* www.ahwkong.com

Don’t EVER make the mistake that you can design something better than what
you get from ruthless massively parallel trial-and-error with a feedback
cycle. That’s giving your intelligence *much* too much credit.


- Linus Torvalds
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110713/e520efbe/attachment.html>


More information about the Python-list mailing list