python中string库用法详解
Python 详解 string 用法
2023-09-11 14:15:15 时间
源码解释:
"""A collection of string constants.
Public module variables:
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
"""
示例代码:
import string
aa = string.ascii_letters
print(aa)
bb = string.ascii_lowercase
print(bb)
cc = string.ascii_uppercase
print(cc)
dd = string.hexdigits
print(dd)
ee = string.printable
print(ee)
运行结果:
更多用法详见源码...
相关文章
- python WSGI框架详解
- python中日志logging模块的性能及多进程详解
- 利用python求解物理学中的双弹簧质能系统详解
- 利用python求解物理学中的双弹簧质能系统详解
- 【python cookbook】【字符串与文本】9.将Unicode文本统一表示为规范形式
- Python异步编程之concurrent.futures中的Future对象详解
- 华为OD机试 - 计算礼品发放的最小分组数目(Java & JS & Python)
- Python编程语言学习:包导入和模块搜索路径(包路径)简介、使用方法(python系统环境路径的查询与添加)之详细攻略
- Py之scikit-image:Python库之skimage的简介、安装、使用方法之详细攻略
- Python语言学习之字符串那些事:python和字符串的使用方法之详细攻略
- 已解决(Python安装报错)Visit python.org to download an earlier version of Python.
- 打基础丨Python图像处理入门知识详解
- 【阶段二】Python数据分析NumPy工具使用04篇:数组常用分析函数、数组广播与数组和矩阵的点积运算
- 【项目实战】Python实现GBDT(梯度提升树)回归模型(GradientBoostingRegressor算法)项目实战
- python ast
- python f-string
- 【华为机试真题详解 Python实现】新员工座位安排系统【2023 Q1 | 100分】
- 【华为机试真题 Python实现】跳格子游戏【2022 Q2 | 200分】
- Python编程:查找算法之顺序查找和二分查找
- Python编程:twine模块打包python项目上传pypi
- python 将一个JSON 字典转换为一个Python 对象
- Appium+python自动化(一)- 环境搭建—上(超详解)
- python基础===Excel处理库openpyxl
- python字符串连接的三种方法及其效率、适用场景详解
- Python OpenCV实现图像模板匹配详解
- 【Leetcode刷题Python】297. 二叉树的序列化与反序列化
- 【Leetcode刷题Python】剑指 Offer 18. 删除链表的节点
- Python 面向对象编程详解
- Python 常用内置模块详解
- 量子笔记:量子计算 toy python implementation from scratch
- 【Python】3.python实现图片上传到阿里云OSS