Zen of Python: Difference between revisions

Content deleted Content added
m Being Pythonic: added list comprehension example to the being pythonic section.
Tag: Reverted
Undid revision 1288135135 by Bsmillstein (talk) although arguably accurate, not part of the official glossary definition
Line 66:
for piece in food:
print(piece)
</syntaxhighlight>
And the cleanest, most Pythonic method would be a list comprehension:
<syntaxhighlight lang="python">
[print(piece) for piece in food]
</syntaxhighlight>
</blockquote>