Skip to content

Instantly share code, notes, and snippets.

@ysmood
Last active December 29, 2015 17:59
Show Gist options
  • Select an option

  • Save ysmood/7708045 to your computer and use it in GitHub Desktop.

Select an option

Save ysmood/7708045 to your computer and use it in GitHub Desktop.
def buildCoder(shift):
def gen(a, z): return zip(map(chr, range(a, z)), map(chr, range(a + shift, z - shift) + range(a + 25 - shift, z)))
return dict( gen(ord('a'), ord('z')) + gen(ord('A'), ord('Z')) )
print buildCoder(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment