Answer to Question #245054 in Python for Raju

Question #245054

Replacing Characters of Sentence

You are given a string s,write a program to replace each letter of the string with the next letter that comes in the English Alphabet.


1
Expert's answer
2021-09-30T15:28:42-0400
s = str(input("Enter a string: "))


output = ""
for i in range(len(s)):
    if s[i].isalpha():
        output += chr(ord(s[i])+1)
    else:
        output += s[i]


print()
print("Output: ", output)

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