Created
June 3, 2011 20:31
-
-
Save adeleinr/1007108 to your computer and use it in GitHub Desktop.
Python Cheatsheet
This file contains 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
List Comprehensions | |
===================== | |
list = [each + 1 for each in range(10)] | |
Ternary Operator | |
================= | |
x if a > b else y | |
(a > b) and x or y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment