Python中String模块中的常量

      String模块中的常量:

string.digits:数字0~9

string.letters:所有字母(大小写)

string.lowercase:所有小写字母

string.printable:可打印字符的字符串

string.punctuation:所有标点

string.uppercase:所有大写字母

>>> import string  
>>> string.digits  
'0123456789'  
>>> string.letters  
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'  
>>> string.lowercase  
'abcdefghijklmnopqrstuvwxyz'  
>>> string.printable  
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'  
>>> string.punctuation  
'!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'  
>>> string.uppercase  
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'  
From   https://blog.csdn.net/sheila_1988/article/details/7243256

你可能感兴趣的:(python_string)