I want to use the array.index(x) function multiple times to find the element index in a small list and its place within a larger list. For example, I have...
a=1
b=2
c=1
d=2
small_list = [a, b, c]
full_list = [d, c, b, a]
x=small_list.index(c)
y=full_list.index(x)
z=full_list[y]
When running, I get...
x=0
y=0
z=2
But I want to get...
x=2
y=1
z=1
How do I change my code to do this? I can see that it is looking up the value of c when I run the code. How do I stop this happening?
EDIT: My own answer to my problem is below.
ValueError: 0 is not in list. Is this your actual code?small_listis not 2.