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

Chris Angelico rosuav at gmail.com
Wed Oct 30 08:17:51 EDT 2013


On Wed, Oct 30, 2013 at 11:01 PM, Antoon Pardon
<antoon.pardon at rece.vub.ac.be> wrote:
> Because it is a pain in the ass. Now suddenly my program doesn't work
> because I somehow inserted a tab instead of spaces.

I broadly agree with your post (I'm of the school of thought that
braces are better than indentation for delimiting blocks), but I don't
think this argument holds water. All you need to do is be consistent
about tabs OR spaces (and I'd recommend tabs, since they're simpler
and safer), and you'll never have this trouble. Also, the parser
should tell you if you mix tabs and spaces, so that won't trip
anything either.

ChrisA



More information about the Python-list mailing list