1.

Write a python program to printthe following patienn-- the pattern will be-1 in the 1st line12 in the 2nd line123 in the 3rd line1234 in the 4th line12345 in the 5th line...​

Answer»

Explanation:

# 1-12-123-1234 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(j, end="")

print()

OUTPUT :

Enter number of rows: 6

Enter number of rows: 61

Enter number of rows: 6112

Enter number of rows: 6112123

Enter number of rows: 61121231234

Enter number of rows: 6112123123412345

Enter number of rows: 6112123123412345123456

I THINK THIS IS CORRECT



Discussion

No Comment Found