[Tutor] What is this [] construction?

John Fouhy john at fouhy.net
Tue Mar 3 04:56:47 CET 2009


2009/3/3 Wayne Watson <sierra_mtnview at sbcglobal.net>:
> What is this: d = [ int(x) for x in s.split(":") ]

It's a list comprehension:
http://docs.python.org/tutorial/datastructures.html#list-comprehensions

-- 
John.


More information about the Tutor mailing list