I have a python list containing n elements, out of which n-1 are identical and 1 is not. I need to find the position of the distinct element.
For ex : Consider a python list [1,1,1,2,1,1].
I need the to find out the position of 2 in the list.
I can use a for loop to compare consecutive elements and then use two more for loops to compare those elements with the other elements. But is there a more efficient way to go about it or perhaps a built-in function which I am unaware of?