News for hackers. Stuff that matters.
Re:Intermediate Python by heyalexej on Monday August 17, 2015 @04:16PM (#10075816)
I consider myself somewhere in the spectrum between beginner and intermediate and I use enumeration quite often. I picked it up early on in a tutorial by Andrew Montalenti (founder of http://www.parsely.com and quite active in the Python community) and use it ever since instead of wrapping it into another loop like beginner tutorials teach you. For example if I need to read in a file with 5 million lines but for debugging or performance optimization reasons want to break the loop after 1K lines.
Re:Intermediate Python by p1esk on Monday August 17, 2015 @04:24PM (#10075863)
All beginner tutorials I used introduced "enumerate" early on.

Indexing is probably the first thing you're wondering about when you start coding in Python after coding in C.