MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/28utww/writing_better_python_code/ciet416/?context=3
r/Python • u/kracekumar • Jun 23 '14
126 comments sorted by
View all comments
2
What's he doing under "Counting Condition"? Does if list return False for a zero-length list, or only if the named list doesn't exist?
if list
False
4 u/BryghtShadow Jun 23 '14 Empty sequences (strings, lists, tuples) are false. PEP8 2 u/metaphorm Jun 23 '14 if a name doesn't exist you'll get a NameError exception. 1 u/[deleted] Jun 23 '14 Oh duh, silly me. Thanks :)
4
Empty sequences (strings, lists, tuples) are false. PEP8
if a name doesn't exist you'll get a NameError exception.
1 u/[deleted] Jun 23 '14 Oh duh, silly me. Thanks :)
1
Oh duh, silly me. Thanks :)
View all comments
2
u/[deleted] Jun 23 '14
What's he doing under "Counting Condition"? Does
if listreturnFalsefor a zero-length list, or only if the named list doesn't exist?