码迷,mamicode.com
首页 > 编程语言 > 详细

python3 输出字符

时间:2019-08-29 18:38:40      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:ons   uppercase   abc   str   pytho   red   def   int   upper   

import string

‘‘‘
whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a string containing all ASCII decimal digits
hexdigits -- a string containing all ASCII hexadecimal digits
octdigits -- a string containing all ASCII octal digits
punctuation -- a string containing all ASCII punctuation characters
printable -- a string containing all ASCII characters considered printable

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
‘‘‘
print(string.ascii_uppercase+string.ascii_lowercase+string.digits) #大写字母+小写字母+数字


输出:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789



python3 输出字符

标签:ons   uppercase   abc   str   pytho   red   def   int   upper   

原文地址:https://www.cnblogs.com/DirWang/p/11430863.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!