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

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

 

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