"elis aeris" <[EMAIL PROTECTED]> wrote > for x in xrange (20, 0): > print x > > this doesn't work because it goes from a big number to a small > number, which > does nothing > but what if I need the for loop to go from a big number to a small > number?
Add a 3rd step-value argument to range. (You don't need the xrange on modern versions of Python BTW) If you make the step negative it will count down: >>> range(20,0,-4) [20, 16, 12, 8, 4] >>> HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor