Python的string模块
Posted 球球64
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python的string模块相关的知识,希望对你有一定的参考价值。
如果要使用string模块,需要先导入该模块
import string
string.ascii_lowercase #打印所有的小写字母
string.ascii_uppercase #打印所有的大写字母
string.ascii_letters #打印所有的大小写字母
string.digits #打印0-9的数字
string.punctuation #打印所有的特殊字符
string.hexdigits #打印十六进制的字符
string.printable #打印所有的大小写,数字,特殊字符
以上是关于Python的string模块的主要内容,如果未能解决你的问题,请参考以下文章
Python练习册 第 0013 题: 用 Python 写一个爬图片的程序,爬 这个链接里的日本妹子图片 :-),(http://tieba.baidu.com/p/2166231880)(代码片段