The State of Python

Vespe Savikko vespe at cs.tut.fi
Fri Jul 28 13:14:57 EDT 2000


Also sprach Guido van Rossum <guido at beopen.com>:

  I've placed the slides of my talk at the O'Reilly Open Source
  Convention on-line at our BeOpen PythonLabs website:
  
      http://www.pythonlabs.com/talks.html
  
The first example on slide 14, List Comprehensions:

[(x, x**2) for x in range(5)] 
     -> [(0,0), (1,1), (4,4), (9,9), (16,16)]

My intuition says the result should be:

     -> [(0,0) ,(1,1), (2,4), (3,9), (4,16)]

Is there a typo in the slide or have I missed some aspect of list
comperehensions? 

  ++Vespe

-- 
  ------------------------------------------------------------------
       Vespe Savikko     vespe at cs.tut.fi     - to doom de doomsday -



More information about the Python-list mailing list