How to use a double while loop in python?

python

Solution

Because your j gets 11 after first iteration. Need to reset it:

i = 0
j = 1
while i < 10:
    j= 1 #<-- here
    while j < 11:
        print i, j
        j+=1
    i+=1

Problem

Does a python double while loop work differently than a java double loop? When I run this code: ``` i = 0 j = 1 while i < 10: while j < 11: print i, j j+=1 i+=1 ``` I get the following output: 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 I want it to keep looping to print 1 0, 1 1, 1 2, ... 2 0, 2 1, 2 3... etc. Why does it stop after only one iteration?

Original source