Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: