# lists and tuples are essentially the same # lists are delimited by brackets, []; tuples by parentheses, () >>> a = [ 1, 2, 3 ] >>> b = (4, 5, 6) >>> a[0] Out[4]: 1 >>> b[0] Out[5]: 4 >>> a[1:3] Out[6]: [2, 3] >>> b[1:3] Out[7]: (5, 6) # lists are mutable, tuples are not >>> a[0] = 'hello' >>> a Out[9]: ['hello', 2, 3] >>> b[0] = 'bye' Traceback (most recent call last): File "/Users/rcd/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2721, in run_code exec code_obj in self.user_global_ns, self.user_ns File "", line 1, in b[0] = 'bye' TypeError: 'tuple' object does not support item assignment # tuples are commonly returned by Python functions >>> zip(a, b) Out[11]: [('hello', 4), (2, 5), (3, 6)]