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