Returns the number of matching letters in these two words.
(word1, word2)
| 106 | |
| 107 | |
| 108 | def numMatchingLetters(word1, word2): |
| 109 | """Returns the number of matching letters in these two words.""" |
| 110 | matches = 0 |
| 111 | for i in range(len(word1)): |
| 112 | if word1[i] == word2[i]: |
| 113 | matches += 1 |
| 114 | return matches |
| 115 | |
| 116 | |
| 117 | def getComputerMemoryString(words): |