python基础===string模块常量

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 '

 

posted @ 2018-05-11 16:36  AAA五金批发王建军  阅读(332)  评论(0编辑  收藏  举报