range() is not the best way to check range?

Simon Forman rogue_pedro at yahoo.com
Tue Jul 18 12:59:43 EDT 2006


Dan Bishop wrote:
> Summercoolness at gmail.com wrote:
> > it seems that range() can be really slow:
> ...
> >     if i in range (0, 10000):
>
> This creates a 10,000-element list and sequentially searches it.  Of
> course that's gonna be slow.

And you're doing it 30000 times.




More information about the Python-list mailing list