[Tutor] Nested for loops

Andreas Perstinger andipersti at gmail.com
Wed Nov 27 17:38:13 CET 2013


Rafael Knuth <rafael.knuth at gmail.com> wrote:
>I am trying to figure out how exactly variables in nested loops are
>generated, and don't get it 100% right yet. Here's my code:

Maybe it's easier if you look at a simpler example like:

for i in range(4):
    for j in range(4):
        print("i: {}, j: {}".format(i, j))

Do you understand how that works?

Bye, Andreas


More information about the Tutor mailing list