Print Alphabets

 Coding Problem Keys 

 Print Alphabets 

 Problem Statement 

Given two alphabets C1 and C2 as input, the program must print the alphabets from C1 to C2 (inclusive of C1 and C2).

 Boundary Condition(s) 

a <= C1 < z
C1 < C2 <= z

 Input Format 

The first line contains the two alphabets C1 and C2 separated by space(s).

 Output Format 

The first line contains the alphabets from C1 to C2 (inclusive of C1 and C2) separated by a space.

 Example Input/Output 1 

 Input 

a d

 Output 

a b c d

 Explanation 

The alphabets from a to d is abcd. Hence the output is a b c d.

 Example Input/Output 2 

 Input 

g l

 Output 

g h i j k l

 Explanation 

The alphabets from g to l is ghijkl. Hence the output is g h i j k l.

 Max Execution Time Limit: 5000 millisecs 

 Solution 

 Programming Language: Python 3 Language 

a,b=input().split()
for i in range(ord(a),ord(b)+1):
    print(chr(i),end=" ")

# Published By PKJCODERS

 (Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.) 

Comments

Popular Posts

Reversed Sum of Pairs

Find Generation Gap

Infinite Sequence Nth Digit

Pattern - X to Y Rotate

Reverse Characters in a string

Count the 1s in the binary representation