how to find index of repeating variable

前端 未结 0 1421
南方客
南方客 2020-12-02 03:21

I want find the index of the repeating variable.

Example:

mylist = [2, 4, 6, 8, 2, 10, 2, 12, 14]

If I write mylist.index("2"), it would say 0

相关标签:
回答
  • 消灭零回复
提交回复
热议问题