Created
April 3, 2013 08:48
-
-
Save cyeong/5299550 to your computer and use it in GitHub Desktop.
python inline for if else
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [item for item in items if cond] | |
| [item if cond else something_else for item in items] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment