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

import string

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

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

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

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

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

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

Python的string模块的更多相关文章

  1. python中string模块各属性以及函数的用法

    任何语言都离不开字符,那就会涉及对字符的操作,尤其是脚本语言更是频繁,不管是生产环境还是面试考验都要面对字符串的操作.     python的字符串操作通过2部分的方法函数基本上就可以解决所有的字符串 ...

  2. 牛人总结python中string模块各属性以及函数的用法,果断转了,好东西

    http://blog.chinaunix.net/uid-25992400-id-3283846.html http://blog.csdn.net/xiaoxiaoniaoer1/article/ ...

  3. Python之string模块(详细讲述string常见的所有方法)

    相信不少学习python的程序员都接触过string模块 string模块主要包含关于字符串的处理函数 多说无益,初学python的小伙伴还不赶紧码起来 接下来将会讲到字符串的大小写.判断函数. 以及 ...

  4. python 字符串 string模块导入及用法

    字符串也是一个模块,有自己的方法,可以通过模块导入的方式来调用 1,string模块导入 import string 2,  其用法 string.ascii_lowercase string.dig ...

  5. python(string 模块)

    1.string 模块下关键字源码定义 whitespace = ' \t\n\r\v\f' ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz' ascii_ ...

  6. python 之 string() 模块

    common string oprationsimport string1. string constants(常量) 1) string.ascii_letters       The concat ...

  7. python中string模块

    >>> import string >>> string.ascii_letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL ...

  8. python之string模块常量:数字,26个字母,标点符号,空白

    In [8]: import string In [9]: dir(string) In [10]: string.ascii_letters Out[10]: 'abcdefghijklmnopqr ...

  9. python基础===string模块常量

    In [8]: import string In [9]: dir(string) In [10]: string.ascii_letters Out[10]: 'abcdefghijklmnopqr ...

随机推荐

  1. 通过ambari安装hadoop集群,ZT

    通过ambari安装hadoop集群,ZT http://www.cnblogs.com/cenyuhai/p/3295635.html http://www.cnblogs.com/cenyuhai ...

  2. git 提交代码场景

    1.首次提交代码到master git init git add . git commit -m '' git remote add origin +address git push -u origi ...

  3. Arthur and Brackets CodeForces - 508E (贪心,括号匹配)

    大意: n个括号, 位置未知, 给出每对括号左右间距, 求输出一个合法括号序列. 最后一个括号间距一定为1, 从右往左遍历, 每次括号划分越小越好. #include <iostream> ...

  4. iptables -F 与 -X 区别

    test: 1.iptables 初始化 2.iptables -X (第一次) 错误原因是自定义链表(test)不为空 3.iptables -F 4.iptables -X ok,实验结束 实验报 ...

  5. RabbitMQ、Redis、Memcache

    Memcached Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态.数据库驱动网站的速度 ...

  6. Jaxb 完全手册

    Jaxb是JavaEE的规范.全称Java Architecture for XML Binding. 可以根据XML Schema产生Java类的技术.JAXB也提供了将XML实例文档反向生成Jav ...

  7. Java环境下shiro的测试-认证与授权

    Java环境下shiro的测试 1.导入依赖的核心jar包 <dependency> <groupId>org.apache.shiro</groupId> < ...

  8. ScheduledThreadPoolExecutor

    java提供了方便的定时器功能,代码示例: public class ScheduledThreadPool_Test { static class Command implements Runnab ...

  9. 关于jsp页面的一些知识(一)

    1,<%@ include file=” ”%> ——最简洁易懂的解释 http://blog.csdn.net/little_stars/article/details/17373477 ...

  10. Vue.js 引入外部js方法

    1.外部文件config.js 第一种写法 //常量的定义 const config = { baseurl:'http://172.16.114.5:8088/MGT2' } //函数的定义 fun ...