网络编程
位置:首页>> 网络编程>> Python编程>> python 返回列表中某个值的索引方法

python 返回列表中某个值的索引方法

作者:叽吧叽  发布时间:2021-05-25 21:44:13 

标签:python,索引

如下所示:


list = [5,6,7,9,1,4,3,2,10]

list.index(9)

out:3

同时可以返回列表中最大值的索引list.index(max(list))

最小值索引list.index(min(list))

来源:https://blog.csdn.net/weixin_42442855/article/details/82824083

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com