question on list comprehensions

Fredrik Lundh fredrik at pythonware.com
Thu Oct 14 16:53:46 CEST 2004


Darren Dale wrote:

> I need to replace the following loop with a list comprehension:
>
> res=[0]
> for i in arange(10000):
>     res[0]=res[0]+i

why?

</F> 






More information about the Python-list mailing list