+ 1
How to solve the secret message code coach using chr() and ord()?
I solved this coach a month ago using dictionary and now i want to solve it in this way. The wrong thing is: If you enter "o", it shows "l" But when you enter "Sololearn" It shows hoooo.... Please help
3 Respostas
+ 5
From my point of view, the issue is using replace(), as this replaces all occurrencies of a character. There are replacements that are correct, but others are done by accident. You can visualize what really happens by using this website. copy your code and paste it there, then perform "Visualize Execution".
http://www.pythontutor.com/visualize.html#
+ 1
The problem is causing like
You give
Input : aba
Process:
zbz
zxa
Output: zxa (should be zxz)
Also your ASCII values are not correct.
+ 1
Thank you for helping.
All the test cases worked.
https://code.sololearn.com/cu7Ykq7ltPh3/?ref=app