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
4 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
0
SANJAY S KUMAR You can use ordinal value to get characters n=input().split() d={} c=25 for i in range(122,96,-1): k=chr(i-c) v=chr(i) d[k]=v c-=2 w=[] p="" for i in n: for j in i.lower(): p+=d[j] w.append(p) p="" w=" ".join(w) print(w)
25th May 2020, 7:25 PM
Prince Kumar
Prince Kumar - avatar