iterating in reverse

Nick Vargish nav at adams.patriot.net
Fri Jan 17 15:34:03 EST 2003


David Eppstein <eppstein at ics.uci.edu> writes:

> But actually, I think your original method doesn't work so well with 
> negative numbers, here's a slight modification:

I'm summing the number of bytes used in a file repository (I wish I
could just use "du", but alas...), so negative numbers are not a
factor. But I like the generator approach, very tricky.

Thanks,

Nick

-- 
# sigmask.py  ||  version 0.2  ||  2003-01-07  ||  Feed this to your Python.
print reduce(lambda x,y:x+chr(ord(y)-1),'Ojdl!Wbshjti!=obwAqbusjpu/ofu?','')





More information about the Python-list mailing list