Python Program to Print 1-22-333-4444 Pattern up To n Lines


This program prints or generates 1-22-333-4444 pattern up to n lines given by user in Python language.


Python Source Code: 1-22-333-4444 Pattern


# 1-22-333-4444 Pattern up to n lines

n = int(input("Enter number of rows: "))

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

Output

Enter number of rows: 8
1
22
333
4444
55555
666666
7777777
88888888