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