I've a numeric list containing several repeated items like such:
list1 = [40, 62, 0, 5, 8, 3, 62]
And a word list containing corresponding words:
list2 = ['cat', 'dog', 'turtle', 'fox', 'elephant', 'eagle', 'scorpion']
i.e. there are 40 cats, 62 dogs, etc.
Data above is merely for representation. Each value in list1 is assigned an English dictionary word in list2 corresponding to the indexes i.e. index 0 of the first list corresponds to index 0 of the second list.
How can I be sure that in a for-loop, if I call list1.index(i) where i is 62, it would return me eagle first, and then when the for-loop is executed again, it would skip the first 62 and proceed to the second 62 and return me scorpion?