for x in range(1,6): for y in range(5,x,-1): print("",end="") for z in range(0, x): print(x,end="") print()
Output:1
22
333
4444
55555
Problem: This code is mine only.i am experimenting on patterns of numbers and all i found that if remove the print() word in last line the program does not work! Can Someone tell me print() at last line is neccessary? and if neccessary but why? and explanation?