Integers Repeat Pattern

122
0
Home Python Integers Repeat Pattern

The program must accept an integer N as the input. The program must print the desired pattern as shown in the Example Input/Output section.

Boundary Condition(s):
2 <= N <= 100
Input Format:
The first line contains N.

Output Format:
The lines contain the desired pattern as shown in the Example
Input/Output section.

Example Input/Output 1:
Input:
3
Output:
3333
4414
5525
6636
3333

Example Input/Output 2:
Input:

4
Output:
44444
55515
66626
77737
88848
44444

a=int(input())
b=str(a)*(a+1)
c=a+1

print(b)

for i in range(a):
	h=str(c)*(a-1)
	print(h,end="")
	print(i+1,c,sep="")
	c+=1

print(b)
Hephzibai
WRITTEN BY

Hephzibai

Hephzibai is a driven third-year student at St. Joseph's Institute of Technology, specializing in Computer Science and Engineering. With a keen interest in data science and also in fullstack.
One of my greatest strengths lies in my programming skills, which I've honed through countless hours of practice and participation in coding challenges. Platforms like Skillrack, HackerRank, and others have been my playgrounds, where I've tackled a wide range of problems with creativity and determination.

Leave a Reply

Your email address will not be published. Required fields are marked *