Created
May 14, 2019 12:33
-
-
Save kzinmr/60ed90ff4913381a30d18123c5963d29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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