首页 > 编程语言 > 详细

python string 模块

时间:2020-03-23 11:29:51      阅读:64      评论:0      收藏:0      [点我收藏+]
>>> import string
>>> dir(string)
[Formatter, Template, _ChainMap, _TemplateMetaclass, __all__, __built
ins__, __cached__, __doc__, __file__, __loader__, __name__, __packag
e__, __spec__, _re, _string, ascii_letters, ascii_lowercase, ascii_u
ppercase, capwords, digits, hexdigits, octdigits, printable, punctua
tion, whitespace]
>>> string.ascii_lowercase  #所有的小写字母
abcdefghijklmnopqrstuvwxyz
>>> string.ascii_uppercase  #所有的大写字母
ABCDEFGHIJKLMNOPQRSTUVWXYZ
>>> string.hexdigits        #所有的十六进制字符
0123456789abcdefABCDEF
>>> string.whitespace       #所有的空白字符
 \t\n\r\x0b\x0c
>>> string.punctuation      #所有的标点字符
!"#$%&\‘()*+,-./:;<=>?@[\\]^_`{|}~

 set和未set后的区别

技术分享图片

 

python string 模块

原文:https://www.cnblogs.com/GoubuLi/p/12550902.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!