Python列表元素访问和计数-index()-count()---len()-成员资格判断

列表元素访问和计数

1,通过索引直接访问元素

image
image

2,index()获得指定元素在列表中首次出现的索引

image
image
image

3,count()获得指定元素在列表中出现的次数

image

4,len()返回列表长度

image

5,成员资格判断

image
image
image

posted @ 2022-08-03 16:22  18小子  阅读(124)  评论(0)    收藏  举报