x = (4, 7, 8) print type(x) y = 6, 3, 4 print type(y) print x[1] 7 x[1] = 5 Traceback (most recent call last): File "C:\Users\Susan\AppData\Local\Enthought\Canopy\User\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 x[1] = 5 TypeError: 'tuple' object does not support item assignment x = ([4,2,3], [6,7]) print type(x) print type(x[1]) x[0] = [6, 7, 8] Traceback (most recent call last): File "C:\Users\Susan\AppData\Local\Enthought\Canopy\User\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 x[0] = [6, 7, 8] TypeError: 'tuple' object does not support item assignment print x ([4, 2, 3], [6, 7]) x[0][1] = 9 print x ([4, 9, 3], [6, 7]) x[0].remove(0) Traceback (most recent call last): File "C:\Users\Susan\AppData\Local\Enthought\Canopy\User\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 x[0].remove(0) ValueError: list.remove(x): x not in list x[0][0].remove(0) Traceback (most recent call last): File "C:\Users\Susan\AppData\Local\Enthought\Canopy\User\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 x[0][0].remove(0) AttributeError: 'int' object has no attribute 'remove' x[0].append(3) print x ([4, 9, 3, 3], [6, 7]) x[0].remove(4) print x ([9, 3, 3], [6, 7]) x = [2*n for n in range(10000)] print x [0, 2, 4, 6, 8, ..., 19990, 19992, 19994, 19996, 19998] # List too big to show all of it y = (2*n for n in range(10000)) print y at 0x0000000003EA91B0> z = [w for w in y] print z [0, 2, 4, 6, 8, 10, 12, ... 19988, 19990, 19992, 19994, 19996, 19998] # list too big to show zz = [v for v in y] print zz [] zzz = [v for v in (2*n for n in range(10000)) x ] File "", line 3 x ^ SyntaxError: invalid syntax zzz = [v for v in (2*n for n in range(10000))] print zzz [0, 2, 4, 6, 8, 10, 12, ... 19986, 19988, 19990, 19992, 19994, 19996, 19998] # list too big to show