python3-快速输出所有字母、数字及可打印符号

0x00 使用chr转换ASCII码

1、输出所有的大写字母

print([chr(i) for i in range(65,91)])

2、输出所有小写字母

print([chr(i) for i in range(97,123)])

3、输出所有的数字字符

print([chr(i) for i in range(48,58)])0x01 string是一个字符串常量的集合的包。

公共模块变量:

whitespace -- 包含所有空白的字符串

ascii_lowercase -- 包含所有小写字母的字符串

ascii_uppercase -- 一个包含所有ASCII大写字母的字符串

ascii_letters -- 包含所有ASCII字母的字符串

digits -- 包含所有十进制位数的字符串

hexdigits -- 包含所有 十六进制数字的字符串

octdigits -- 包含所有八进制数字的字符串

punctuation -- 包含所有标点字符的字符串

printable -- 包含所有可打印的字符的字符串

import string

# 1、输出所有的大写字母

print(string.ascii_uppercase)

# 2、输出所有小写字母

print(string.ascii_lowercase)

# 3、输出所有的数字字符

print(string.digits)

人生苦短,我用Python!

发表评论
留言与评论(共有 0 条评论)
   
验证码:

相关文章

推荐文章

'); })();