Homework 9: Palindrome Program

Objective: To examine a user-entered string to determine if it's a palindrome.

A palindrome is a word that is spelled the same forward and backward, such as "radar" or "madam." Your program should ask the user to enter a word, and then tell the user whether or not that word is a palindrome. Your program doesn't need to determine whether or not the word is in the English language. So for example your program would determine that the word "abcdefghijjihgfedcba" is a palindrome.

Here is some sample output from the program:

[cpersiko@fog cs110a]$ python3 palindrome.py.txt 
Please enter a word: Radar
The word you entered: 'Radar' is a palindrome.
Do you want to enter another word? yes
Please enter a word: abcCBA
The word you entered: 'abcCBA' is a palindrome.
Do you want to enter another word? Y
Please enter a word: abcdecba
The word you entered: 'abcdecba' is not a palindrome.
Do you want to enter another word? n
[cpersiko@fog cs110a]$ 

Requirements:

For 1 point extra credit

Make your program so that it also checks for palindromic phrases: remove all punctuation and spacing, then check if it's a palindrome. For example:
[cpersiko@fog cs110a]$ python3 palindrome.py.txt 
Please enter a word or phrase: No sir, away! A papaya war is on!
The text you entered: 'No sir, away! A papaya war is on!' is a palindrome.
Do you want to enter another? yes
Please enter a word or phrase: Madam In Eden, I'm Adam
The text you entered: 'Madam In Eden, I'm Adam' is a palindrome.
Do you want to enter another? No
[cpersiko@fog cs110a]$ 
You may want to use the "isalpha()" function and/or others described in the Python docs for string methods.