Skip to content

Instantly share code, notes, and snippets.

@4383
Last active November 23, 2020 14:57
Show Gist options
  • Save 4383/3713d90485102154c165b19a6601e936 to your computer and use it in GitHub Desktop.
Save 4383/3713d90485102154c165b19a6601e936 to your computer and use it in GitHub Desktop.
Python ROT13 converter / deconverter
import string #fixed typo was using
text = str(input('tip your text to convert: ', ))
rot13 = string.maketrans(
"ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz",
"NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm")
string.translate(text, rot13)
# Example
# 'Hello World!
# 'Uryyb Jbeyq!
@4383
Copy link
Author

4383 commented Nov 23, 2020

@Michael-Schulze Much appreciated, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment