x = (4, 2, 8) print x (4, 2, 8) print type(x) y = 8, 7, 1 print type(y) print y (8, 7, 1) print x[1] 2 y[0] = 2 Traceback (most recent call last): File "C:\Users\Susan\AppData\Local\Enthought\Canopy\App\appdata\canopy-2.1.3.3542.win-x86_64\lib\site-packages\IPython\core\interactiveshell.py", line 2885, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in y[0] = 2 TypeError: 'tuple' object does not support item assignment z = ([5,2],[9,1]) print z ([5, 2], [9, 1]) print type(z) z[0][1] = 12 print z ([5, 12], [9, 1]) z[0].append(4) print z ([5, 12, 4], [9, 1]) z[0].remove(5) print z ([12, 4], [9, 1]) z[0].append(4) z[0].remove(4) z[0].remove(12) print z ([4], [9, 1]) z[0].remove(4) print z ([], [9, 1]) v,w = 8,3 print v 8 print w 3 w = "winter is coming now".split() print w ['winter', 'is', 'coming', 'now'] for (index,item) in enumerate(w): print index print item 0 winter 1 is 2 coming 3 now for (foo, bar) in enumerate(w): print foo,bar 0 winter 1 is 2 coming 3 now for x in enumerate(w): print type(x), x (0, 'winter') (1, 'is') (2, 'coming') (3, 'now') print enumerate(w) print range(len(w)) [0, 1, 2, 3]