![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
面北
人生靠内涵和才华!!!
展开
-
python的字符串方法详解(二)
1、center(width, str)若string字符串总长度小于参数width,则在string字符串的两侧填充给定字符str;否则不改变字符串string = "hello"print(string.center(11,"0"))结果为:000hello0002、count(str)统计string字符串中给定字符串str的次数string = "hello,world...原创 2019-08-13 17:13:36 · 159 阅读 · 0 评论 -
python的字符串方法详解(一)
1、zfill(width)若string字符串长度小于width,则会将string字符串左侧补字符‘0’扩充至width长度string = "hello"print(string.zfill(8))结果为:000hello2、capitalize()将string字符串的首字母变为大写string = "hello world"print(string.capitali...原创 2019-08-06 22:44:08 · 174 阅读 · 0 评论 -
虚拟机(云服务器)上安装python环境
1、首先下载python的依赖包yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc* make -y2、下载python安装包安装完python的依赖包之后下载python安装包wget https://www....原创 2019-08-15 20:01:10 · 2411 阅读 · 1 评论