string.ascii_lowercaseがRのlettersに対応するPythonの定数です。
使用例
>>> from string import ascii_lowercase >>> ascii_lowercase 'abcdefghijklmnopqrstuvwxyz'
ちなみに、Rのlettersはこちらです。
> letters [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" [18] "r" "s" "t" "u" "v" "w" "x" "y" "z"
その他の文字列定数
こちらを参照下さい。
string – Common string operations – Python 3.8.0 documentation
おわりに
RのlettersのようなPythonの文字列定数を紹介しました。
今回の記事はこちらを参考にしました。
r – Sequence of letters in Python – Stack Overflow
では。
—
YouTube: ミサキさん
問い合わせ先
Mail: caprico.aries@gmail.com
Twitter: https://twitter.com/caprico_aries(無言フォローもお気軽に)
コメント