Python Program To Generate Pattern 21

Python Program To Generate Pattern 21

Write Python Program To Generate Pattern 21

# Write Python Program To Generate Pattern 21

n = 3
i = 1

while(i <= n):
    j = 1
    while(j <= i):
        print(i, end = ' ')
        j = j + 1
    print('')
    i = i + 1

Output:

1 
2 2 
3 3 3