I have written an application. The goal is to read data from this dictionary (it is a dictionary because I have more lists within it, however they are not relevant to this question so I cut them out):

```
initialDictionary = {
    "xCoordinate": [2, 4, 6, 3, 6],
}

```

As seen, the xCoordinate 6 is a duplicate, so to get rid of the duplicate I do this:

```
affectedCoordinates = list(set(initialDictionary["xCoordinate"]))

```

This then results in a new list but without the duplicates.

```
[2, 3, 4, 6]

```

Now I want to find the index (location) of every item of affectedCoordinates in the original initialDictionary, to do this I have done this:

```
for affectedCoordinate in (affectedCoordinates):
    if affectedCoordinate in initialDictionary["xCoordinate"]:
        print(initialDictionary["xCoordinate"].index(affectedCoordinate))

```

However, this reads the original list within initialDictionary from left to right, so it prints:

0
3
1
2

This is wrong. I want the index of whatever duplicate is the farthest right in the initialDictionary list (read right to left instead of left to right). So the application should print this:

0
3
1
4

Here's my entire code:

```
initialDictionary = {
    "xCoordinate": [2, 4, 6, 3, 6],
    "state": [1, 1, 1, 1, 0]
}

affectedCoordinates = list(set(initialDictionary["xCoordinate"]))
print(initialDictionary["xCoordinate"])
print(affectedCoordinates)

for affectedCoordinate in (affectedCoordinates):
    if affectedCoordinate in initialDictionary["xCoordinate"]:
        print(initialDictionary["xCoordinate"].index(affectedCoordinate))

```