> First case looks quite nasty, because it's for more complicated > things, not numerical loops. Second is very nice, but with there's > problem. If i do ..in range(1, 100000000).. (what I really need > sometimes), it takes few hundred megs of memory and slows > down. Are there other good ways for this simple problem? Generators?
Use xrange(). It computes the values as they are needed - not an entire list. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list