[1006]python之string模块常量:数字,26个字母,标点符号,空白

In [8]: import string

In [9]: dir(string)

In [10]: string.ascii_letters
Out[10]: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

In [11]: string.ascii_lowercase
Out[11]: 'abcdefghijklmnopqrstuvwxyz'

In [12]: string.ascii_uppercase
Out[12]: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

In [13]: string.digits
Out[13]: '0123456789'

In [14]: string.punctuation
Out[14]: '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'

In [15]: string.whitespace
Out[15]: '\t\n\x0b\x0c\r '

来源:https://www.cnblogs.com/my8100/p/7068512.html

上一篇:2021-06-21


下一篇:打印字符