rank | vote | view | answer | url |
---|---|---|---|---|
16 | 3261 | 3993138 | 30 | url |
比如["foo","bar","baz"]
和它的一个元素"bar"
,用什么方法能找到它的下标(1)?
>>> ["foo","bar","baz"].index('bar')
1
rank | vote | view | answer | url |
---|---|---|---|---|
16 | 3261 | 3993138 | 30 | url |
比如["foo","bar","baz"]
和它的一个元素"bar"
,用什么方法能找到它的下标(1)?
>>> ["foo","bar","baz"].index('bar')
1