Skip to content

Instantly share code, notes, and snippets.

@Foovanadil
Created July 2, 2015 04:48
Show Gist options
  • Save Foovanadil/bce1be1252805d3353b9 to your computer and use it in GitHub Desktop.
Save Foovanadil/bce1be1252805d3353b9 to your computer and use it in GitHub Desktop.
String makeTrans example
import string
sourceText = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."
input = "abcdefghijklmnopqrstuvwxyz"
map = "cdefghijklmnopqrstuvwxyzab"
trans = string.maketrans(input,map);
print sourceText.translate(trans);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment