w = [2*x for x in range(10000)] print w[-10:] [19980, 19982, 19984, 19986, 19988, 19990, 19992, 19994, 19996, 19998] y = (2*x for x in range(10000)) print len(x) 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 print len(x) TypeError: object of type 'int' has no len() print len(w) 10000 print len(y) 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 print len(y) TypeError: object of type 'generator' has no len() print sum(w) 99990000 print sum(y) 99990000 print sum(y) 0