Python之路
霄汉景行
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python 列表list
列表(list)是一种有序的数据集合 列表常用方法: 1.lst.append(x):将x元素添加到列表的末尾 lst = ['python','c','c++'] lst.append('php') print(lst) >>> ['python','c','c++','php'] 2.lst.insert(i,x):将x插入索引i的位置 lst = ['a',...原创 2019-02-22 23:30:18 · 489 阅读 · 0 评论 -
Python字符串常用方法
count():获取字符串中某个字符的数量。 str = 'python_count' str.count('o') >>> 2 strip():删除字符串首位的空格,以及换行。 str1 = ' hello python ' str2 = 'hello python ' str3 = ' hello python' str1.strip() str...原创 2019-02-20 22:29:07 · 340 阅读 · 0 评论
分享