21
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

python 文字列変換【カタカナ⇔ひらがな】

Last updated at Posted at 2019-03-19

#jaconvを使った変換
jaconv (Japanese Converter) はひらがな・カタカナ・全角・半角の文字種変換ができます
※全角⇔半角の変換に関しては"mojimoji"の方が高速処理できます
###カタカナ⇔ひらがな

change.py
import jaconv

word1 = "リンゴ"
change_word1 = jaconv.kata2hira(word1)
# ⇒りんご

word2 = "ぷりん"
change_word2 = jaconv.hira2kata(word2)
# ⇒プリン
21
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?