Multiples of a number

Robert Kern robert.kern at gmail.com
Sun Nov 6 05:41:26 CET 2005


Steven D'Aprano wrote:

> Another way is, if you aren't doing anything *except* counting for the
> other 99 values of x, just skip them completely:
> 
> fox x in range(20):
>     do_something(x*100)
> 
> Ivan, what are you trying to do?

Presumably he's doing something substantive on every 1-increment; he
just needs to do something extra (like print some diagnostic
information) on every 100-increment.

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Python-list mailing list