in the example the sentence is Nice Day.
the previous letter of N is M, similarly replace each letter with the previous letter
N i c e D a y
M h b d C z x
so the output should be Mhbd Czx
sample input 1
Nice Day
sample output 1
Mhbd Czx
sample input2
Be good and do good
sample output2
Ad fnnc zmc cn fnnc
list1 = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
input1 = input('Enter input here: ').lower()
for i in input1:
if i in list1:
input2 = input1.replace(i,list1[list1.index(i)-1])
print(input2)
Comments
Leave a comment