Skip to content

Instantly share code, notes, and snippets.

@bmackenty
Created September 9, 2020 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmackenty/111ae86a1be1e42a9cc6ad8436abd93d to your computer and use it in GitHub Desktop.
Save bmackenty/111ae86a1be1e42a9cc6ad8436abd93d to your computer and use it in GitHub Desktop.
def rot13(phrase):
abc = "abcdefghijklmnopqrstuvwxyz"
out_phrase = ""
for i in phrase:
out_phrase = out_phrase + abc[(abc.find(i)+13)%26]
return out_phrase
phrase = input("Enter phrase you want encrypted: ")
print(rot13(phrase))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment