A little morning puzzle

alex23 wuwei23 at gmail.com
Sun Sep 23 23:46:23 EDT 2012


On Sep 23, 1:44 pm, Dwight Hutto <dwightdhu... at gmail.com> wrote:
> Just because you can use a function, and make it look easier, doesn't
> mean the function you used had less code than mine, so if you look at
> the whole of what you used to make it simpler, mine was on point.

Word of advice: when we use "simpler" around these parts we're
referring to cognitive burden on the end developer and not the actual
amount of interpreter/library code utilised to solve the problem.

Ergo: 'enumerate(<some_list>)' is the correct suggestion over manually
maintaining your own index, despite it ostensibly being "more" code
due to its implementation.



More information about the Python-list mailing list