Skip to content

Instantly share code, notes, and snippets.

@mlconnor
Last active August 29, 2015 14:05
Show Gist options
  • Save mlconnor/ad6c8c46b09b86d7f80b to your computer and use it in GitHub Desktop.
Save mlconnor/ad6c8c46b09b86d7f80b to your computer and use it in GitHub Desktop.
Python notes
Good basic intro on types
https://docs.python.org/2/tutorial/introduction.html
https://docs.python.org/2/tutorial/controlflow.html
blocks use : and indent
while a < b:
print a
if x < 0:
...x = 0
...print 'Negative changed to zero'
elif x == 0:
...print 'foo'
... words = ['cat', 'window', 'defenestrate']
>>> for w in words:
... print w, len(w)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment