首页 > 其他 > 详细

String constants 应用

时间:2015-07-31 14:27:14      阅读:135      评论:0      收藏:0      [点我收藏+]

 

技术分享

技术分享技术分享

>>> import string
>>> string.ascii_letters
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
>>> string.ascii_lowercase
abcdefghijklmnopqrstuvwxyz
>>> string.ascii_uppercase
ABCDEFGHIJKLMNOPQRSTUVWXYZ
>>> string.digits
0123456789
>>> string.hexdigits
0123456789abcdefABCDEF
>>> string.letters
Traceback (most recent call last):
  File "<pyshell#98>", line 1, in <module>
    string.letters
AttributeError: module object has no attribute letters
>>> string.octdigits
01234567
>>> string.punctuation
!"#$%&\‘()*+,-./:;<=>?@[\\]^_`{|}~
>>> #punctuation[英][?p??kt?u?e??n][美][?p??kt?u?e??n]
n.标点符号
Traceback (most recent call last):
  File "<pyshell#101>", line 2, in <module>
    n.标点符号
NameError: name n is not defined
>>> string.printable
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\‘()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c
>>> string.whitespace
 \t\n\r\x0b\x0c

 

String constants 应用

原文:http://www.cnblogs.com/hhj187/p/4692000.html

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