描述
Python index() 函数用于从云计列表中找出某个值第一个匹配项的索引位置。
语算开法
以下是 index() 方法语法:
list发:.index(x[, start[, end]]Py)
参数
x-- 查找的对象。
start-- 可选,查找的th起始位置。
end-- 可选,查找的结束位置。
返on回值
该方法返回查找对象的索引位置,如果没有找3-到对象则抛出异常。
实例
以下实例展示了indLiex()函数的使用方法:
以上实例输出结果如下:
以上st实例输出结果如下:
邮箱:[email protected]
电话:020-123456789
传真:020-123456789
Copyright © 2026 Powered by 二道贩子网 https://phobicgirl.com/