Skip to content

Instantly share code, notes, and snippets.

@mukeshkdangi
Created March 30, 2014 07:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mukeshkdangi/9868851 to your computer and use it in GitHub Desktop.
Save mukeshkdangi/9868851 to your computer and use it in GitHub Desktop.
import string
j = ' '
def buildCoder(shift):
n = shift
cnt=1
for i in string.ascii_uppercase:
if cnt==1:
print '{','\b',
j= (ord(i)-ord('A') + n)%26 + ord('A')
print '\''+i +'\''+': '+'\''+unichr(j)+'\'','\b',
print '\b,',
cnt=cnt+1
for i in string.ascii_lowercase:
j= (ord(i)-ord('a') + n)%26 + ord('a')
print '\''+i +'\''+': '+'\''+unichr(j)+'\'','\b',
if i=='z':
print ''
else:
print '\b,',
#print i + ':' + unichr(j),'\b',
print '','\r}'
buildCoder(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment