Python3基础 str endswith 是否以指定字符串结束
- 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 = 'HELLOHELLO'
In [2]: my_str
Out[2]: 'HELLOHELLO'
In [3]: my_str.endswith('LO')
Out[3]: True
In [4]: my_str.endswith('LLO')
Out[4]: True
In [5]: my_str.endswith('LL')
Out[5]: False
In [6]: 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 endswith 是否以指定字符串结束的更多相关文章
- Python3基础 str __add__ 拼接,原字符串不变
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
- Python3基础 str split 用指定的字符将字符串分割
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str find+index 是否存在指定字符串,有则返回第一个索引值
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 translate 将指定字符转换成另一种特定字符
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 ...
- Python3基础 str casefold 返回全是小写字母的新字符串
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str capitalize 返回新字符串,第一个字母大写
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str : 对字符串进行切片
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
随机推荐
- 推荐两个国外网站-帮你优化网站SEO和预测下期的PR值
第一个:http://www.domaintools.com/ (谷歌SEO网站优化伴侣)可以测试你优化网站的分数. 这里使用说明,简单说一下吧: 打开网站后输入自己的域名,点击搜索按钮 第二个查看分 ...
- BZOJ5056 OI游戏 最短路+组合数学
链接接接接接! 正解:最短路+小学奥数 乘法原理 解题报告: 首先读懂题意(,,,我觉得我吃枣死于语文太差读不懂题目QAQ 大意就是港,要求从第一个点到其他各点的长度都是最短的方案有多少个(ummm, ...
- AndroidStudio自定义TODO
1.增加自定义TODO标记 Preferences -> Editor -> TODO,然后点击左下角的加号,输入想要自定义的TODO的正则 输入\bX\b.*(X为TODO标签的名字), ...
- git clone远程branch和tag
1.查看远程分支 git branch -r 2.测试git clone romete,只是clone远程remote的master,不会clone其他的目录 -------------------- ...
- Stringbuffer扩容
public class A { public static void main(String[] args) { StringBuffer ab=new StringBuffer(); String ...
- xls的读写
import xlrd # 读取xls文件 # 打开xls文件 data = xlrd.open_workbook('x1.xls') print(type(data)) # 获取表Sheet1 ta ...
- sql server递归日期
在做项目任务时,需要将一个日期范围转换为日期表. 例如:日期范围(2017年01月21日~2017年02月20日).转换成一日为单位的日期表,如下. 2017-01-21 2017-01-22 201 ...
- 006-spring cloud gateway-GatewayAutoConfiguration核心配置-GatewayProperties初始化加载、Route初始化加载
一.GatewayProperties 1.1.在GatewayAutoConfiguration中加载 在Spring-Cloud-Gateway初始化时,同时GatewayAutoConfigur ...
- 自定义WordPress文件上传路径
自WordPress 3.5版本开始,隐藏了后台媒体设置页面的“默认上传路径和文件的完整URL地址”选项,可以通过下面的代码将该选项调出来. 将下面的代码添加到当前主题functions.php文件中 ...
- PHPExcel 基本用法详解
.header header("Content-Type:application/vnd.ms-excel"); header("Content-Disposition: ...