Skip to content

Instantly share code, notes, and snippets.

@jblomo
Created January 20, 2012 06:52
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 jblomo/1645841 to your computer and use it in GitHub Desktop.
Save jblomo/1645841 to your computer and use it in GitHub Desktop.
python intro
In [1]: print "hello"
hello
In [2]: 1+1
Out[2]: 2
In [3]: added = 1 + 1
In [4]: print added
2
In [5]: alist = [1, 2, 3, 4]
In [6]: len(alist)
Out[6]: 4
In [7]: alist[0]
Out[7]: 1
In [8]: adict = {"one": 1, "two": 2, "three": 3}
In [9]: len(adict)
Out[9]: 3
In [10]: adict["one"]
Out[10]: 1
In [11]: aset = set([1, 2, 3, 2, 3])
In [12]: aset
Out[12]: set([1, 2, 3])
In [13]: aset[0]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment