![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
文章平均质量分 66
刘泉Nicole
这个作者很懒,什么都没留下…
展开
-
[string]字符串比较
方法:startwith( )作用:判断字符串是否以指定字符或子字符串开头一、函数说明语法:string.startswith(str, beg=0,end=len(string)) 或string[beg:end].startswith(str) 参数说明:string: 被检测的字符串str: 指定的字符或者子字符串。(可以使用元组,会逐一匹配)beg: 设置字符...转载 2018-05-25 23:36:15 · 165 阅读 · 0 评论 -
外部输入报错问题
if len(strs)==0: return ('') #如果列表为空 if len(strs)==1: return strs[0]#如果列表中只有一个元素转载 2018-05-26 00:08:04 · 142 阅读 · 0 评论 -
Python学习(一)数据类型和变量
一 、整数十六进制用0x前缀和0-9,a-f表示,例如:0xff00,0xa5b4c3d2二、浮点数浮点数就是小数浮点数可以用数学写法,如1.23,3.14,-9.01,等等。但是对于很大或很小的浮点数,就必须用科学计数法表示,把10用e替代,1.23x109就是1.23e9,或者12.3e8,0.000012可以写成1.2e-5,等等。整数和浮点数在计算机内部存储的方式是不同的,整数运算永远是精...转载 2018-05-22 17:50:39 · 185 阅读 · 0 评论 -
python显示图
参考:https://blog.csdn.net/gatieme/article/details/61416645matplotlib 中提供的 subplot 可以很好的解决这个问题subplot(numRows, numCols, plotNum)图表的整个绘图区域被分成 numRows 行和 numCols 列然后按照从左到右,从上到下的顺序对每个子区域进行编号,左上的子区域的编号为1plo...原创 2018-05-28 21:37:48 · 260 阅读 · 0 评论