Questions: While And List Comprehension

James Mills prologic at shortcircuit.net.au
Thu Nov 11 10:49:27 CET 2010


On Thu, Nov 11, 2010 at 6:10 PM, Peter Otten <__peter__ at web.de> wrote:
> (line for line in sys.stdin)
>
> and sys.stdin are equivalent as are
>
> [v for v in items]
>
> and list(items)
>
> So
>
> print list(islice(sys.stdin, 5))

I was being a little verbose ... But I like your simplification :)

cheers
James

-- 
-- James Mills
--
-- "Problems are solved by method"



More information about the Python-list mailing list