Skip to content

Instantly share code, notes, and snippets.

@FranklyFuzzy
Created August 16, 2022 02:19
Show Gist options
  • Save FranklyFuzzy/6f77ed35b66c94fa715cb03ccbfefdbe to your computer and use it in GitHub Desktop.
Save FranklyFuzzy/6f77ed35b66c94fa715cb03ccbfefdbe to your computer and use it in GitHub Desktop.
Quick shift cipher using ord and chr
#Found an issue where going from negative to positive int removes space so just shift starting positive int then shift back negative the same int.
text = input('what is the text: ')
key = input('What is the shift: ')
for i in text:
uni = ord(i)
encode = int(uni) + int(key)
print(chr(encode), end='')
#print(i, uni)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment