Computer Science, asked by sony04, 9 months ago

Write a python program to print
the following patienn-
- the pattern will be-
1 in the 1st line
12 in the 2nd line
123 in the 3rd line
1234 in the 4th line
12345 in the 5th line...

Answers

Answered by snehapandit
0

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

Similar questions