First day beginner to python, add to counter after nested loop

jonas.thornvall at gmail.com jonas.thornvall at gmail.com
Wed Oct 30 04:52:16 EDT 2013


Den onsdagen den 30:e oktober 2013 kl. 08:07:31 UTC+1 skrev Tim Roberts:
> jonas.thornvall at gmail.com wrote:
> 
> >
> 
> >Why did Python not implement end... The end is really not necessary for
> 
> >the programming language it can be excluded, but it is a courtesy to
> 
> >the programmer and could easily be transformed to indents automaticly,
> 
> >that is removed before the compiliation/interpretation of code.  
> 
> 
> 
> You only say that because your brain has been poisoned by languages that
> 
> require some kind of "end".  It's not necessary, and it's extra typing. 99%
> 
> of programmers do the indentation anyway, to make the program easy to read,
> 
> so why not just make it part of the syntax?  That way, you don't
> 
> accidentally have the indentation not match the syntax.
> 
> -- 
> 
> Tim Roberts, timr at probo.com
> 
> Providenza & Boekelheide, Inc.

It maybe common practice in program languages, but to me it is slightly confusing to have the while/for loop on the same indent level, as the regular statements.
Because when the while loop ends there is no other identification then that the indent stopped, and to me it is easy to interpret that terms that actually straight under the loop belongs to it.

But of course it is a matter of adjust the way i look at the code.
Thanks for help guys.



More information about the Python-list mailing list