For example, lets say I have a list example=[A,B,C,D]
How do I return the value of the position? So for A, I would want a returned value of 0. B would be 1, C would be 2, D would be 3.
For example, lets say I have a list example=[A,B,C,D]
How do I return the value of the position? So for A, I would want a returned value of 0. B would be 1, C would be 2, D would be 3.
you are looking for .index() of a list object
['a', 'b', 'c', 'd'].index('c') # 2