in python: iterate over each string in a list,c = sum(1 for word in words if word[0] == word[-1])