Answer to Question #307108 in Python for ratul

Question #307108

Write a Python program that takes a string as an input from the user containing all small letters and then prints the next alphabet in sequence for each alphabet in the input.

Hint: You may need to use the functions ord() and chr(). The ASCII value of ‘a’ is 97 and ‘z’ is 122.

1
Expert's answer
2022-03-08T07:12:03-0500
s = (str(input("Enter a string: "))
print("INput String: ",s)
ss = ""
for r in range(0,len(s)):
    ss = ss+chr(ord(s[r])+1)
print("New String: ",ss)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS