I'm trying to set the second appearance of a text in a list to 0. The first appearance of the word should remain untouched.
e.g.
Xlist=["dog", "cat", "horse", "dog"]
The outcome should look like this:
["dog", "cat", "horse", "0"]
Is there a simple way to do it? Since I'm new to python programming I can't really imagine how to do it and I didn't find a way in other threads.