I want to get the indexposition of a sublist in a nested list, e.g 0 for [1,2] in nested_ls = [[1,2],[3,4]]. What's the most elegant way of getting the index of the sublist, is there something similar to index() ?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Yes. It's called
index
.