type
status
date
slug
summary
tags
category
icon
password
生活不是电影 没有那么多兜兜转转 错过了就真的没有啦。
python 中str字符串 和list列表基本操作总结
补充
index:通过元素查询索引
count:查找某个元素在列表中的个数。
l1.reverse()
len() 统计列表的元素的总个数。
l1 = [1, 2, ['alex', 'barry'], 33]
l1[1] = 200
l1[2][0] = l1[2][0].upper()
元组:
(1, 'ale', True)
查:索引,切片, 切片(步长) for循环
index,count,len()
(1, 'ale', True,[1,2,3])
Python 修改列表中所有的元素
- Author:Alan_Hsu
- URL:https://xmylog.com/article/articles_python_list
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts