Skip to content

Instantly share code, notes, and snippets.

@kzinmr
Created May 14, 2019 12:33
Show Gist options
  • Save kzinmr/60ed90ff4913381a30d18123c5963d29 to your computer and use it in GitHub Desktop.
Save kzinmr/60ed90ff4913381a30d18123c5963d29 to your computer and use it in GitHub Desktop.
def katakana_to_hiragana(string):
result = ''
for character in string:
code = ord(character)
if ord('ァ') <= code <= ord('ヶ'):
result += chr(code - ord('ァ') + ord('ぁ'))
else:
result += character
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment