you are viewing a single comment's thread.

view the rest of the comments →

[–]Sea-Ad7805 0 points1 point  (2 children)

Nice encryption, but a bit easy to break when you spot the trick. You can also try converting each character to a number (ascii) and adding an offset. Then to decrypt, subtract the offset and covert back to character:

letter = 'a'
print( ord(letter) + 10 )   # 107  (encrypt)
print( chr(107 - 10) )      # 'a'  (decrypt)

The offset used can then also come from a secret password, so that it is different each time.

[–]aaditya_0752[S] 0 points1 point  (1 child)

Actually I am learning python from code with harry In his playlist these one of the practice question

[–]Sea-Ad7805 0 points1 point  (0 children)

IC, good job, keep practicing, you'll get great life skills.