Skip to content

Instantly share code, notes, and snippets.

@mingrammer
Created May 25, 2017 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingrammer/205e9bd45a5b1d6dca026ffc3e4abb06 to your computer and use it in GitHub Desktop.
Save mingrammer/205e9bd45a5b1d6dca026ffc3e4abb06 to your computer and use it in GitHub Desktop.
Two styles of writing 'if' statement
### without elif, else
if cond == 'one':
# something
return # or break
if cond == 'two':
# something
return # or break
# something
return # or break
### use elif, else
if cond == 'one':
# something
elif cond == 'two':
# something
else:
# something
return # or break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment