I'm trying to get this number pattern
0
01
012
0123
01234
012345
0123456
01234567
012345670
0123456701
But I can't figure out how to reset the digits when I reach over 8 in my function. There is my code:
def afficherPatron(n):
triangle = ''
for i in range(0, n):
triangle = triangle + (str(i))
print(triangle)
i+=1
Thanks in advance to all of you!
i+=1, theforloop increments the variable automatically.nor just some sort of cyclic limitation you wanted to be?