Skip to content

Instantly share code, notes, and snippets.

@Ruhshan
Created November 10, 2016 19:35
Show Gist options
  • Save Ruhshan/5cf8fedb63d4c8aefa93e5c3e5737a75 to your computer and use it in GitHub Desktop.
Save Ruhshan/5cf8fedb63d4c8aefa93e5c3e5737a75 to your computer and use it in GitHub Desktop.
# -*- coding: UTF-8 -*-
def upside_down(inp):
#print upside-down of a given alphabetic string
rev_dict = {'z': u'z', 'y': u'ʎ', 'x': u'x',
'w': u'ʍ', 'v': u'ʌ', 'u': u'n',
't': u'ʇ', 's': u's', 'r': u'ɹ',
'q': u'b', 'p': u'd', 'o': u'o',
'n': u'u', 'm': u'ɯ', 'l': u'\u0285',
'k': u'ʞ', 'j': u'ɾ', 'i': u'ᴉ',
'h': u'ɥ', 'g': u'ƃ', 'f': u'ɟ',
'e': u'ǝ', 'd': u'p', 'c': u'ɔ',
'b': u'q', 'a': u'ɐ', ' ': u' '}
o = u''
for c in inp[::-1]:
try:
o += rev_dict[c]
except:
continue
print o
upside_down("Python programmin language")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment