Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> lst = [1,2,3] >>> lst[2] 3 >>> lst[5] Traceback (most recent call last): File "", line 1, in IndexError: list index out of range >>> lst = [0] * 100 >>> len(lst) 100 >>> lst [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] >>> lst[99] = 1 >>> d = {} >>> d[99] = 1 >>> d {99: 1} >>> d[99] 1 >>> lst = [0,0,0,0,0,1,0,0,1,0,0,0] >>> dan = ['dan', 26, ['teaching', 'icecream mmm']] >>> dan[0] 'dan' >>> from record import people >>> people {'dan': {'interests': ['teaching', 'icecream'], 'age': 26, 'name': 'dan'}, 'joe' : {'interests': ['video games', 'biking', 'sleeping'], 'age': 22, 'name': 'joe'} , 'steph': {'interests': ['biking'], 'age': 24, 'name': 'steph'}} >>> people['joe'] {'interests': ['video games', 'biking', 'sleeping'], 'age': 22, 'name': 'joe'} >>> people['joe']['interests'] ['video games', 'biking', 'sleeping'] >>> people['joe']['interests'][1] 'biking' >>> people.values() [{'interests': ['teaching', 'icecream'], 'age': 26, 'name': 'dan'}, {'interests' : ['video games', 'biking', 'sleeping'], 'age': 22, 'name': 'joe'}, {'interests' : ['biking'], 'age': 24, 'name': 'steph'}] >>> people.keys() ['dan', 'joe', 'steph'] >>> from interests import interests >>> people {'dan': {'interests': ['teaching', 'icecream'], 'age': 26, 'name': 'dan'}, 'joe' : {'interests': ['video games', 'biking', 'sleeping'], 'age': 22, 'name': 'joe'} , 'steph': {'interests': ['biking'], 'age': 24, 'name': 'steph'}} >>> interests (people) ['teaching', 'icecream', 'video games', 'biking', 'sleeping'] >>> people['steph']['interests'] ['biking'] >>> people['steph']['interests'][0] = 'Biking' >>> interests (people) ['teaching', 'icecream', 'video games', 'biking', 'sleeping', 'Biking'] >>> lst = [[0, 0, 4], [0, 0, 0], [0, 3, 0]] >>> lst = [(1, 2), (3, 4)] >>> lst [(1, 2), (3, 4)] >>> dict(lst) {1: 2, 3: 4} >>> lst = [1, 2, 3, 4] >>> lst [1, 2, 3, 4] >>> dict(lst) Traceback (most recent call last): File "", line 1, in TypeError: cannot convert dictionary update sequence element #0 to a sequence >>> lst = [(1, 2), 3] >>> dict(lst) Traceback (most recent call last): File "", line 1, in TypeError: cannot convert dictionary update sequence element #1 to a sequence >>> s = 'ab' >>> dict(s) Traceback (most recent call last): File "", line 1, in ValueError: dictionary update sequence element #0 has length 1; 2 is required >>> lst = ['ab', 'cd'] >>> dict(lst) {'a': 'b', 'c': 'd'}