Code coach : encode

code coach question to reverse each character of the string i.e. a=z , b=y and so on; but problem is, its not showing correct answer. example input = solo learn , expected output = hlol ovzim , my output = slol ovzim. if you have read this comment,please try to debug it,and comment below the correction https://code.sololearn.com/cKfdKjD1rS3w/?ref=app

25th Jan 2020, 5:44 PM
Karan Sharma
Karan Sharma - avatar
3 Answers
+ 2
Your first letter is not changed. That's because you increment i in the while parentheses. You should just do it at the end of the block.
25th Jan 2020, 6:02 PM
HonFu - avatar
+ 2
HonFu thanks man, now it's working fine. Mihai Apostol lol...yes it was a silly mistake😅😅
26th Jan 2020, 5:52 PM
Karan Sharma
Karan Sharma - avatar
+ 1
HonFu is right. Karan Sharma Just for conformity "Z" ascii code is 90 not 93.
25th Jan 2020, 6:09 PM
Mihai Apostol
Mihai Apostol - avatar