Write a function palindromes(words) that takes a list of strings and returns a new list
containing only those strings that read the same forwards and backwards, keeping the
original order. Use a comprehension rather than an explicit loop.
Example
palindromes(['level', 'python', 'radar']) -> ['level', 'radar']
Implement this function:
def palindromes(words: list) -> list:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: words.
Input
['level', 'python', 'radar']
Output
['level', 'radar']