Answer to Question #266755 in Python for sai krishna

Question #266755

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


1
Expert's answer
2021-11-16T18:37:56-0500
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)

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