title: Compare characters in strings python
body: <p>I'm trying to compare the characters from 2 separate strings, the idea is that i will return a value corresponding to how many characters the strings both share. for example, if string one was 'mouse' and string 2 was 'house'. They would share 4/5 characters. its important to note that they only share a character if it is in the same 'index position'</p>
  
  <pre><code>def compareWords(word1, word2):
  result = 0
  if word1[0] in word2[0]:
      result += 1
  if word1[1] in word2[1]:
      result += 1
  if word1[2] in word2[2]:
      result += 1
  if word1[3] in word2[3]:
      result += 1
  if word1[4] in word2[4]:
      result += 1
  if word1[5] in word2[5]:
      result += 1
      print result, '/5'
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/j0vOo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j0vOo.png" alt="working result"></a></p>
  
  <p><a href="https://i.stack.imgur.com/KyHyy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KyHyy.png" alt="non-working result"></a></p>