Skip to content

Instantly share code, notes, and snippets.

@nus
Created May 17, 2010 08:08
Show Gist options
  • Save nus/403525 to your computer and use it in GitHub Desktop.
Save nus/403525 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# coding :utf-8
# reverse of 'wizard' is 'wizard'
reverse_wizard = ''
for c in 'wizard'[::-1]:
reverse_wizard += chr((ord('z') - ord(c)) + ord('a'))
print reverse_wizard
# one liner
# print [chr((ord('z') - ord(c)) + ord('a')) for c in 'wizard'[::-1]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment