Python3基础 str swapcase 英文字母大小写反转
- Python : 3.7.0
- OS : Ubuntu 18.04.1 LTS
- IDE : PyCharm 2018.2.4
- Conda : 4.5.11
- typesetting : Markdown
code
coder@Ubuntu:~$ source activate py37
(py37) coder@Ubuntu:~$ ipython
Python 3.7.0 (default, Jun 28 2018, 13:15:42)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: my_str = "hello WORLD"
In [2]: my_str
Out[2]: 'hello WORLD'
In [3]: my_str.swapcase()
Out[3]: 'HELLO world'
In [4]: exit
(py37) coder@Ubuntu:~$ source deactivate
coder@Ubuntu:~$
resource
- [文档] docs.python.org/3
- [规范] www.python.org/dev/peps/pep-0008
- [规范] zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/python_language_rules
- [源码] www.python.org/downloads/source
- [ PEP ] www.python.org/dev/peps
- [平台] www.cnblogs.com
- [平台] gitee.com
Python具有开源、跨平台、解释型、交互式等特性,值得学习。
Python的设计哲学:优雅,明确,简单。提倡用一种方法,最好是只有一种方法来做一件事。
代码的书写要遵守规范,这样有助于沟通和理解。
每种语言都有独特的思想,初学者需要转变思维、踏实践行、坚持积累。
Python3基础 str swapcase 英文字母大小写反转的更多相关文章
- css 设置英文字母大小写转换(text-transform)
css 设置英文字母大小写转换 CreateTime--2018年5月25日07点16分 Author:Marydon 1.实现:通过text-transform实现 2.text-transfo ...
- Python3基础 str title 单词首字母大写,其余均为小写
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str casefold 返回全是小写字母的新字符串
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str 循环输出list中每个单词及其长度
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str translate 将指定字符转换成另一种特定字符
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str format 位置参数与关键字参数
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str for 输出字符串中的每个字符
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str 通过拆分字符串与插入新的内容形成新的字符串
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str while+iter+next 字符串的遍历
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
随机推荐
- js-之NaN和isNaN
NaN (not is number) 不是一个数字的意思,在js中整型和浮点数都是Number类型. 除此之外,Number还有一个特殊的值,NaN. 一.可能会产生NaN值的情况 1.表达式计算, ...
- Frogger--poj2253
http://poj.org/problem?id=2253 题意:The frog distance (humans also call it minimax distance) between t ...
- SqlServer 凭据
一.理解索引的结构 索引在数据库中的作用类似于目录在书籍中的作用,用来提高查找信息的速度.使用索引查找数据,无需对整表进行扫描,可以快速找到所需数据.微软的SQL SERVER提供了两种索引:聚集索引 ...
- mysql 内置功能 视图介绍
之前的多表查询本质是把多张有关系的表连接在一起组成一张虚拟表,从而进行查询 视图 视图是一个虚拟表(非真实存在),其本质是[根据SQL语句获取动态的数据集,并为其命名], 用户使用时只需使用[名称]即 ...
- 010-jdk1.8版本新特性二-Optional类,Stream流
1.5.Optional类 1.定义 Optional 类是一个可以为null的容器对象.如果值存在则isPresent()方法会返回true,调用get()方法会返回该对象. Optional 是个 ...
- 提示'HTTP消息不可读'
1.提示下面的错误信息 2.修改后的代码,费用接口 import unittest import requests import json import HTMLTestRunner ur1 = 'h ...
- [LeetCode] 195. Tenth Line_Easy tag: Bash
Given a text file file.txt, print just the 10th line of the file. Example: Assume that file.txt has ...
- JS中自定义replace可替换特殊符号$等,但无法忽略大小写的函数
//可替换特殊符号$等,但无法忽略大小写的函数 String.prototype.replaceStr = function (s1, s2) { this.str = this; if (s1.le ...
- SQL备份数据库代码
SQL备份数据库代码 #region 服务每天备份一次数据库 /// <summary> /// 服务每天备份一次数据库 /// </summary> public void ...
- vue.js使用typescript踩坑记
最近在把https://github.com/renrenio/renren-fast-vue这个项目转为typescript,在此记录一下遇到的小坑 name坑:属性该怎么给? 声明文件坑:如何解决 ...