for i in range(n+1): for j in range(1,i+1): print(j,end="") print() code example Example: for i in range(0): print(i) for i in range(0): print(i)