List Comprehension

Skip Montanaro skip at mojam.com
Fri Jul 28 16:03:15 EDT 2000


    Colin> Is the following, from          
    Colin> http://www.pythonlabs.com/talks/PythonState_files/v3_document.htm

    Colin> a misprint? 

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

Yup, looks like it.  

-- 
Skip Montanaro, skip at mojam.com, http://www.mojam.com/, http://www.musi-cal.com/
"To get what you want you must commit yourself for sometime" - fortune cookie




More information about the Python-list mailing list