发布时间:2019-08-26 07:53:37编辑:auto阅读(2526)
本文在Python3.5中进行,python3.5中的list是一个列表函数。其中有几个命令需要注意:index del count。
除此之外基础的append与extend不在叙述
index获得第一次出现的value(值的编号)
示例:index
a = [1,2,3,4,5,6,7,6,1]
eg1 = a.index(3)
print(eg1)
示例:count与del
# count计数,del删除最先选定的索引对应的值
a = [1,2,3,4,5,6,7,6,1]
eg1 = a.count(6)
print(eg1)
上一篇: Python编程学习3:Python 对
下一篇: Python线程isAlive方法
50958
50341
40956
37826
32289
29179
28069
22897
22858
21191
1051°
1728°
1410°
1349°
1611°
1439°
2095°
3637°
3563°
2510°