Hi so I got a problem with a nested loop where the output must be like this:
10 2030 304050 40506070 5060708090
but now I only know to do this which is:
10
1020
102030
10203040
1020304050
and this is my code currently:
def number(n):
num = 0
for i in range(0, n):
num = 10
for j in range(0, i + 1):
print(num, end="")
num = num + 10
print("\r")
n = 5
number(n)
so how I change the code so that the output should be the same as the output needed?
numand see where it's being changed. Debug (or simply dry run) the code and see when the value is updated and if it's being updated correctly.