python标准库手记【1】
来源:互联网 发布:网络助手在哪里打开 编辑:程序博客网 时间:2024/05/29 09:35
# -*- coding:utf-8 -*-import stringmyStr1="hello,world"myStr2="您好,世界"print myStr1print myStr2print "=========="print string.capwords(myStr1)transTable=string.maketrans('elo您','ELO你')print myStr1.translate(transTable)print myStr2.translate(transTable)
转换表和首字母大小
$ python ~/Documents/pylearn/learn1.py
hello,world
您好,世界
==========
Hello,world
hELLO,wOrLd
你好,世界
0 0
- python标准库手记【1】
- python标准库手记【2】
- python标准库手记【3】
- C++手记--标准库类型
- python手记(1)
- python手记-twisted(1)
- python标准库1
- 开始Python -- 标准库(1)
- Python 重要标准库1
- python -- Python 标准库
- Python 手记
- python手记
- python标准库学习1-SYS
- python 标准库库
- Python标准库
- python标准库
- Python标准库
- python 标准库
- memcached在大负载高并发网站上的应用(2)
- bind(this)和es6箭头函数
- 链队列
- npm常用命令
- Docker删除所有启动的容器
- python标准库手记【1】
- redis的数据类型-String
- POJ 2492 A Bug's Life
- MS17-010特别版补丁NSA漏洞
- DHTML技术演示--- 简答复选框,邮箱复选框学习
- git代码管理工具实用技巧
- Python3网络编程
- 系统奔溃了别慌,尝试 DISM.exe 工具修复
- PS_BaseUse_img中多余部分的去除