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.


Expert's answer

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!

LATEST TUTORIALS
APPROVED BY CLIENTS