why I don't like range/xrange

Samuel Karl Peterson skpeterson at nospam.please.ucdavis.edu
Fri Feb 16 21:08:04 EST 2007


Roel Schroeven <rschroev_nospam_ml at fastmail.fm> on Sat, 17 Feb 2007
01:31:13 GMT didst step forth and proclaim thus:

...
> So, the point is that in C you can influence the loop's behavior by
> modifying the loop variable, while you cannot do that in Python (at
> least not in a for-loop).

What's wrong with...

for i in range(10):
    if condition: break

...?
-- 
Sam Peterson
skpeterson At nospam ucdavis.edu
"if programmers were paid to remove code instead of adding it,
software would be much better" -- unknown



More information about the Python-list mailing list