Python program to Expand Strings of Alphabet

str1 = input("Insert starting letter: ")
str2 = input("Insert ending letter: ")
while str1 <= str2:
 print(str1, end=" ")
 str1 = chr(ord(str1) + 1)
print()

 

 

Output:

Insert starting letter: a
Insert ending letter: d
a b c d

 

Insert starting letter: p
Insert ending letter: v
p q r s t u v

Subscribe For Daily Updates