Sep-07-2020, 03:13 PM
num=int(input('Enter the looping number: ')) for i in range(num): for j in range(i): print(i, end=' ') print(" ")I wrote a program myself to get a pattern of user prompted number. It worked as I hoped. But I came across above given code. I need help in understanding both the print part and how it works to give following output.
Enter the looping number: 5
1
2 2
3 3 3
4 4 4 4