x = (4, 7, 2) print type(x) y = 3, 6, 1 print type(y) print x[1] 7 x[0] = 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] = 8 TypeError: 'tuple' object does not support item assignment z = ([5,4], [2, 7, 1]) print type(z) print type(z[0]) z[1][0] = 9 print z ([5, 4], [9, 7, 1]) z[0].append(8) print z ([5, 4, 8], [9, 7, 1]) z[0].remove(4) print z ([5, 8], [9, 7, 1]) (a,b) = (2,3) print a 2 print b 3 x = [2*n for n in range(10000)] print x [0, 2, 4, 6, 8, 10, 12, ... 19992, 19994, 19996, 19998] # not all of list shown y = (2*n for n in range(10000)) print y at 0x0000000003F441B0> z = [w for w in y] print z [0, 2, 4, 6, 8, 10, ..., 19992, 19994, 19996, 19998] # not all shown, list is too big to show all of it zz = [v for v in y] print zz [] y = (2*n for n in range(10000)) b = sum([g for g in y if g%10 == 0]) print b 19990000 zzz = [w for w in (2*n for n in range(10000))] print zzz [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, ..., 19990, 19992, 19994, 19996, 19998] # complete list too long to show