欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

python string类自带的常用字符串data简写

程序员文章站 2022-11-27 14:27:47
ascii_letters = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' ascii_lowercase =...
ascii_letters = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'

ascii_uppercase = 'abcdefghijklmnopqrstuvwxyz'

digits = '0123456789'

hexdigits = '0123456789abcdefabcdef'

letters = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'

lowercase = 'abcdefghijklmnopqrstuvwxyz'

octdigits = '01234567'

printable = '0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz!"#$%&\'()*+,-./:;?@[\\]^_`{|}~ \t\n\r\x0b\x0c'

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

uppercase = 'abcdefghijklmnopqrstuvwxyz'

whitespace = '\t\n\x0b\x0c\r '


使用方式:string.ascii_letters

=>=>