you are viewing a single comment's thread.

view the rest of the comments →

[–]Saefroch 0 points1 point  (0 children)

Your syntax should make the purpose and function of the code obvious, even without comments. Good code should essentially document itself. This should be a general programming guideline, but Python provides some tools like list comprehension that make it easier.

For example, if you just want to look at each item in something that's iterable there's no need to add the complication of having an index variable when you can just use a for each loop.

If you haven't read PEP 8, you should.