how do you make a loop run in reverse?

Xavier Ho contact at xavierho.com
Wed Mar 27 01:19:44 CET 2013


There is a built-in function that reverses an iterable.  Have a look at the
documentation.

xav


On 27 March 2013 10:59, <rahulreddy24 at hotmail.com> wrote:

> So i have a set of for loops that create this :
>
> ***************************************
> ***   ***   ***   ***   ***   ***   ***
> ***   ***   ***   ***   ***   ***   ***
>    ***   ***   ***   ***   ***   ***   ***
>    ***   ***   ***   ***   ***   ***   ***
> ***************************************
>
>                  *
>                 ***
>                *****
>               *******
>              *********
>
> but i want to nest all the loops under one BIG loop that'll run in reverse
> to make this:
>
> ***************************************
> ***   ***   ***   ***   ***   ***   ***
> ***   ***   ***   ***   ***   ***   ***
>    ***   ***   ***   ***   ***   ***   ***
>    ***   ***   ***   ***   ***   ***   ***
> ***************************************
>
>                  *
>                 ***
>                *****
>               *******
>              *********
>               *******
>                *****
>                 ***
>                  *
> ***************************************
>    ***   ***   ***   ***   ***   ***   ***
>    ***   ***   ***   ***   ***   ***   ***
> ***   ***   ***   ***   ***   ***   ***
> ***   ***   ***   ***   ***   ***   ***
> ***************************************
>
> Is this possible?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130327/3799c103/attachment.html>


More information about the Python-list mailing list