title: Question regarding comparison of two lists in Python
body: <p>I'm coding a small game for fun where the computer randomly chooses 4 colors as a secret code and the user's job is to guess what they think the colors are, with clues being given based on how close you are to the secret code. When an element in your guess list is a match, the program appends a clue value of 2 to a new list and if the element in your guess list doesn't match the position but occurs in the secret code list, it should append a value of 1 to our clue list.</p>
  
  <p>A problem I'm having is when you compare your list of guesses with the secret code list. Here is an example:</p>
  
  <p>say if the computer secret code is a list with 4 elements as shown: <code>["Blue", "Yellow", "Green", "Red"]</code>
  and your guess is <code>["Blue", "Blue", "Green", "Red"]</code>, the program returns a clue list<code>[2, 1, 2, 2]</code>. I want it to return <code>[2, 2, 2]</code> because I don't want to double count the Blue guess in the guess list when it only occurs once in the secret code. </p>
  
  <p>Here is the code for the function so far.</p>
  
  <pre><code>def get_clue(secret_code, guess_list):
  clue_list = []    
  for i in range(len(guess_list)):
      if guess_list[i] == secret_code[i]:
          clue_list.append(2)
      elif guess_list[i] != secret_code[i] and guess_list[i] in secret_code:
          clue_list.append(1)
      else:
          clue_list = clue_list
  print("Your Clue is : ", clue_list)
  return clue_list
  </code></pre>