2
2

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.

連続した文字のリストを生成

2
Posted at

['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q']
みたいに指定した文字までのリストが欲しい時
l = [chr(s) for s in range(ord("a"), ord("q")+1)]

日本語だとちょっとめんどくさい
l = [unichr(s) for s in range(ord(u"そ"), ord(u"ぬ")+1)]
これで
[そ ぞ た だ ち ぢ っ つ づ て で と ど な に ぬ]
みたいなリストは得られる。
ただ濁音とか拗音を抜いたものだけを得るうまい方法がみつからない。

2
2
0

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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?