Skip to content

Instantly share code, notes, and snippets.

@mukeshkdangi
Created March 30, 2014 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mukeshkdangi/9868873 to your computer and use it in GitHub Desktop.
Save mukeshkdangi/9868873 to your computer and use it in GitHub Desktop.
Pass text and shift number .
coder=3
text='Hello, world!'
j = ' '
n = coder
for i in text:
if(i>'A'and i<'Z'):
j= (ord(i)-ord('A') + n)%26 + ord('A')
print '\b'+unichr(j),
#print (unichr(j), end=' ')
elif(i>'a'and i<'z'):
j= (ord(i)-ord('a') + n)%26 + ord('a')
print '\b'+unichr(j),
else:
print '\b'+i,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment