Re: range() is not the best way to check range?
- From: "K.S.Sreeram" <sreeram@xxxxxxxxxxxxxxx>
- Date: Tue, 18 Jul 2006 08:42:26 +0530
Summercoolness@xxxxxxxxx wrote:
so if i change the line[snip;]
if i in range (0, 10000):
to
if i >= 0 and i < 10000:
is there an alternative use of range() or something similar that can
be as fast?
you've found that alternative yourself! just use the comparison operators...
in fact, you can write a little more compact as:
if 0 <= i < 10000 :
[sreeram;]
Attachment:
signature.asc
Description: OpenPGP digital signature
- References:
- range() is not the best way to check range?
- From: Summercoolness
- range() is not the best way to check range?
- Prev by Date: Re: range() is not the best way to check range?
- Next by Date: RFC: my iterthreader module
- Previous by thread: Re: range() is not the best way to check range?
- Next by thread: RFC: my iterthreader module
- Index(es):