Integer & Alphabet Pair Pattern
Coding Problem Keys
Integer & Alphabet Pair Pattern
Problem Statement
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.
Input Format
The first line contains N.
Output Format
The first N lines containing the desired pattern as shown in the Example Input/Output section.Boundary Condition(s)
2 <= N < 50Example Input/Output 1
Input
3
Output
1a 2b 3c
4d 5e 6f
7g 8h 9i
Example Input/Output 2
Input
6
Output
1a 2b 3c 4d 5e 6f
7g 8h 9i 10j 11k 12l
13m 14n 15o 16p 17q 18r
19s 20t 21u 22v 23w 24x
25y 26z 27a 28b 29c 30d
31e 32f 33g 34h 35i 36j
Max Execution Time Limit: 500 millisecs
Solution
Programming Language: Python 3 Language
n=int(input())
s=0;c=0
k="abcdefghijklmnopqrstuvwxyz"
for i in range(n):
for j in range(n):
c+=1
if(s>=26): s=1
else: s+=1
print(c,k[s-1],sep="",end=" ")
print()
# Published By PKJCODERS
(Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.)
Comments