Why the word palindrome is not a palindrome?

--Originally published at Fundamentos de Programación

Shouldn’t the word that defines a text that is read the same way backwars or normally be a word with this properties?

pm0aarl_700wa_0

Hello world! Here we come with another daily challenge for TC101.

The challenge was to check if the users input was a palindrome or if there was a palindrome contained in the sentence.

omjmg5w_700wa_0

palindromo1

We have the same function filtrar as in the count words program (now that I think about it I should have just imported the function…)

Inside the code we have something siimilar to whats inside the function filtrar but we use a different list of not acceptable characters that include the ” ” for us to check if the whole sentence is a palindrome, not just single letters.

1d4bjdm_700wa_0

Here are some outputs having the whole sentence be a palindrome or just a word:

palindromes2

palindromes3

Thanks, remember to follow me on twitter @danigguemez

The code is avaliable on github: https://github.com/Guemez/TC1014/blob/master/palindromes.py

If you need help here is a video:

#Tc101 #python #DailyChallenge #palindromes