Suraj Davey Suraj Davey - 7 months ago 41
Python Question

finding the position in the python list where element differs

l1 = [1,2,2,2]

In the list above I know that the element differs in l1[0] is there any way to fetch in dynamically in python. Thanks in advance.


Try this:

l1.index(min(set(l1), key=l1.count))