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

Python的string模块

时间:2018-12-01 20:22:08      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:模块   cas   import   letter   dig   特殊   lower   let   bsp   

如果要使用string模块,需要先导入该模块

import string

string.ascii_lowercase  #打印所有的小写字母

string.ascii_uppercase  #打印所有的大写字母

string.ascii_letters #打印所有的大小写字母

string.digits  #打印0-9的数字

string.punctuation  #打印所有的特殊字符

string.hexdigits #打印十六进制的字符
string.printable  #打印所有的大小写,数字,特殊字符

Python的string模块

标签:模块   cas   import   letter   dig   特殊   lower   let   bsp   

原文地址:https://www.cnblogs.com/qiuqiu64/p/10050617.html

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