Imagem de fundo

Você está desenvolvendo uma função em Python que precisa...

Você está desenvolvendo uma função em Python que precisa verificar se uma determinada palavra é um palíndromo. Um palíndromo é uma palavra que permanece a mesma quando lida de trás para frente, como "radar" ou "level”. Qual das seguintes implementações em Python verifica corretamente se uma palavra é um palíndromo?


A

def is_palindrome(word):

reversed_word = ''.join(reversed(word))

return word == reversed_word


B

def is_palindrome(word):

reversed_word = word[::-1]

return word != reversed_word


C

def is_palindrome(word):

return word == word[::-1]


D

def is_palindrome(word):

return word[::-1]


E

def is_palindrome(word):

for i in range(len(word)):

if word[i] != word[len(word) - i - 1]:

return True

return False