I have this question as homework and I can't figure it out.
You have 2 lists of strings with contents of your choice. Use a loop that goes through the lists and compares the lists elements and displays only the list elements that duplicate (the element exists in both lists). The strings should be displayed even if in one is used uppercase and in the other lowercase or a combination of it.
I don't know why it's not working.
animals = ["dog", "bear", "monkey", "bird"]
pets = ["dog", "bird", "cat", "snake"]
print("The original list 1 : " + str(animals))
print("The original list 2 : " + str(pets))
res = [animals.index(i) for i in pets]
print("The Match indices list is : " + str(res))