I could use a little advice. I am writing a simple version of Mastermind. The computer will choose a random number, which will choose a colour. These colours will be stored in a list (computerColours). The user will try to guess the correct colours in the correct positions. This will be stored in another list (userGuess).

I want to use a For loop to iterate through the colours in the 2 lists. I want to use an if statement to check if a colour is in both lists and see if there is a match. I want to return a Y if the guessed colour is in the same position as the computers list. I want to return a O if the guessed colour is in the computers list but not in the correct position.

I am struggling to get the following code to work:

```
for i in range(4):

        if userGuess[i] == computerColours[i]:
            print("Y")

        elif userGuess[i] != computerColours[i]:
            print("O")

```

Even if a guessed colour is not in the computer lists, it is still returning a O.

How can I include a check which will only return colours that are in both lists.

Thanks in advance