python: find the index of a given value in a list

["foo", "bar", "baz"].index("bar")

 

posted @ 2016-12-25 21:01  清源居士  阅读(476)  评论(0编辑  收藏  举报