Skip to main content
 首页 » 编程设计

python之有没有一种简单的方法可以在 Python 列表中表示 base64 字母表

2025年05月04日9mfryf

字母表(及其索引)可以在这里找到:

http://www.garykessler.net/library/base64.html

有没有比 alphabet = ['A','B',...] 更短的方式来表示这个字母表?

请您参考如下方法:

你可以使用string模块

import string 
alphabet = string.ascii_uppercase + string.ascii_lowercase + string.digits + '+/'