x = [2*x for x in range(10000)] print x[-10:] [19980, 19982, 19984, 19986, 19988, 19990, 19992, 19994, 19996, 19998] y = (2*x for x in range(10000)) print y at 0x0000000003F1B1B0> print len(x) 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(x) 99990000 print sum(y) 99990000 print sum(y) 0