--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?
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.
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.
Here are some outputs having the whole sentence be a palindrome or just a word:
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