classification
Title: example code not working
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: rhettinger, zivkovicperica (2)
Priority: normal Keywords

Created on 2004-12-19 16:35 by zivkovicperica, last changed 2004-12-19 18:27 by rhettinger.

Messages (2)
msg23773 - (view) Author: perica (zivkovicperica) Date: 2004-12-19 16:35
in chapter "9.11 Generator Expressions" in "Python
Tutorial" this example is not working:

>>> sum(i*i for i in range(10))                 # sum
of squares
285

I'm using Python 2.3.4 (GCC 3.4.2) on FreeBSD 5.3 

msg23774 - (view) Author: Raymond Hettinger (rhettinger) Date: 2004-12-19 18:27
Logged In: YES 
user_id=80475

It looks like you have a Python 2.4 tutorial in-hand but are
working with an old version of python, 2.3.4 which did not
have generator expressions.

Here is a link to the tutorial that matches the version on
your system (note it does not have a section 9.11):

http://www.python.org/doc/2.3.4/tut/tut.html

History
Date User Action Args
2004-12-19 16:35:38zivkovicpericacreate