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.
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)
Comments
Leave a comment