Computer Science, asked by Mister360, 3 months ago

Write the program of the following
1
22
333
4444
55555
666666
Language :- Python

Answers

Answered by anindyaadhikari13
1

Answer:

This given program is solved in Python language.

1. Using nested loop. (General way)

for i in range(1,7):

for j in range(1,i+1):

print(i,end="")

print()

2. Using 1 loop (String approach)

for i in range(1,7):

print(str(i)*i)

3. One liner (advanced)

print("\n".join(str(i)*i for i in range(1,7)))

Refer to the attachment for output.

•••♪

Attachments:
Answered by xXMarziyaXx
1

See the above attachment

#Be brainly

Attachments:
Similar questions