Mar-16-2019, 02:47 PM
The program checks if the input text is palindrome. After checking a text like "Rise to vote, sir." it wont find it as palindrome, even if it is. I need to improve a program so that it could ignore punctuation, spaces,case etc. I should specify a tuple "forbidden", where i place such characters, and use the membreship test to determine whether a character should be removed or not.
All my attempts of improving the program using that way crushed with different types of errors. Help me if u can, please.
Here is the initial version of the program
All my attempts of improving the program using that way crushed with different types of errors. Help me if u can, please.
Here is the initial version of the program
def reverse(text): return text[::-1] def is_palindrome(text): return text == reverse(text) something = (input('Input something --> ')) if (is_palindrome(something)): print('The text is polyndrom') else: print('The text is not polyndrom')