Skip to content

Instantly share code, notes, and snippets.

@adeleinr
Created June 3, 2011 20:31
Show Gist options
  • Save adeleinr/1007108 to your computer and use it in GitHub Desktop.
Save adeleinr/1007108 to your computer and use it in GitHub Desktop.
Python Cheatsheet
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