Secret message-Any suggestions? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Secret message-Any suggestions?

Decoded="" alphabet = "abcdefghijklmnopqrstuvwxyz" reverse = alphabet[::-1] Secret=input("Write the secret code:").lower() for i in Secret: if i in alphabet: x=alphabet.find(i) Decoded+=reverse[x] elif i==" ": Decoded+=" " print(Decoded)

25th May 2020, 7:16 PM
Good coder
3 Answers
+ 2
Kuba SiekierzyƄski I believe this is what he is referring to. Not actually trying to create an encryption. https://www.sololearn.com/coach/66?ref=app
25th May 2020, 8:43 PM
ChaoticDawg
ChaoticDawg - avatar
+ 2
ChaoticDawg Gotcha!
25th May 2020, 9:22 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 1
Char for char replacement is trivial to break. And if you do not replace the space, it's simply like you're giving it away already ;) Try perhaps to get it more sophisticated, like replacing the character with another one depending on its position or the position of preceding character or the length of the text and so on. Here's a little spoiler: https://code.sololearn.com/cuKnuo01NOb9/?ref=app
25th May 2020, 8:23 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar