Skip to content

Instantly share code, notes, and snippets.

@siwells
Created October 31, 2011 16:57
Show Gist options
  • Save siwells/1327999 to your computer and use it in GitHub Desktop.
Save siwells/1327999 to your computer and use it in GitHub Desktop.
A little python rot13 coder
#!/usr/bin/python
from string import maketrans
rot13trans = maketrans('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm')
def rot13(text):
return text.translate(rot13trans)
def main():
txt = "hello world"
print rot13(txt)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment