I'm supposed to take a list of words and count all words in it which are 2 or more characters long and where the first and last character are equal.

I came up with two possible solutions:

```
result = 0
for word in words:
    if len(word) >= 2 and word[0] == word[-1]:
        result += 1
return result

```

vs.

```
return len([word for word in words if len(word) >= 2 and word[0] == word[-1]])

```

Which one would be the preferred solution? Or are there even better ones?