string.py中的常量

whitespace = ' \t\n\r\v\f'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_letters = ascii_lowercase + ascii_uppercase
digits = '0123456789'
hexdigits = digits + 'abcdef' + 'ABCDEF'
octdigits = '01234567'
punctuation = r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
printable = digits + ascii_letters + punctuation + whitespace

  

import string
all_key = string.ascii_letters + string.digits + string.punctuation
print(all_key)
print(len(all_key))
 
punctuation   标点符号
posted @ 2023-05-08 22:53  sangern  阅读(8)  评论(0编辑  收藏  举报