Write a python program to display the following pattern:
1
1*2
1*2*3
1*2*3*4
1*2*3*4*5
Answers
Answered by
2
Answer:
row = int(input())
for i in range(0, row):
c = 1
print(c, end='')
for j in range(1,i+1):
print('*', end='')
c = c + 1
print(c, end='')
print(' ')
Explanation:
Answered by
3
Solution:
The given code is written in Python.
for i in range(1,6):
print(*range(1,i+1),sep="*")
Logic:
- Run a loop in the range i = (1 to 5).
- Display list of numbers in the range 1 to i with '*' as separator.
See the attachment for output.
Attachments:
Similar questions
Math,
18 days ago
English,
18 days ago
Social Sciences,
1 month ago
Computer Science,
1 month ago
English,
8 months ago
Math,
8 months ago