I want to know how to find an element in list without iteration
It will raise ValueError if it cannot be found:
You can also use the
As Harper Shelby commented, Python will still have to iterate internally to find the items, but the index or in methods may be slightly quicker than doing it in Python, as the data-structures are implemented in C.. but more importantly,
..is much tidier than..
This is a somewhat strange question. Do you want a hotline with
In the first case I cannot help you. In the second case, have a look at the documentation on lists, specifically the