I have a question on how to do the extra of the following exercise
Write a palindrome method (phrase) that receives a phrase or word and returns if it is palindrome or not. Then, write a main program that asks the user for a word, sends the word to the previous method and then tells the user if it is palindrome.
Extra: develop a more complex method, in which spaces, periods and commas can be included, but they are not taken into account, and where the characters marked are the same as those not marked. It must work with numbers too.
Example for the extra: I heard about mom: it hurt.
The first part develops it like this:
def palindromo(palabra): si_es=1 x= palabra[::-1] if x != palabra: si_es=0 return si_es def principal(): palis=str(input("Digite la palabra: ")) if palindromo(palis): print("La palabra %s es un polindromo" %palis) else: print("La palabra %s no es un polindromo" %palis)