def match_words(words): ctr = for word in words: if len(word) > and word[] == word[-]: ctr += return ctr print(match_words(['abc', 'xyz', 'aba', '']))