Question: Write a python program that prompts the user for a sentence and outputs if the sentence was a palindrome or not. The program should keep

Write a python program that prompts the user for a sentence and outputs if the sentence was a palindrome or not. The program should keep on prompting the user for sentences until the user says differently!

Pseudocode:

- Prompt the user for the sentence to check

- Convert the sentence to all lowercase (or all uppercase) characters.

- Create a new string that will include only the alphabetic characters of the original sentence (no spaces/punctuation) Hint: use a for-loop

- Create a new string with the reverse version of the previous string Hint: use a for-loop (you saw this already in Part3 of this lab)

- Compare the two strings to make the decision

- Print the decision

- Repeat if the user says so

Write a python program that prompts the user for a sentence and

SAMPLE OUTPUT Welcome to the palindrome checker program! Enter a sentence: Never odd or even! This is a palindrome! Do you want to continue (yeso)? yes Enter a sentence: Hello world This is not a palindrome! Do you want to continue (yeso)? Yes Enter a sentence: racecar This is a palindrome! Do you want to continue (yeso)? yeah Enter a sentence: Madam, I'm Adam This is a palindrome! Do you want to continue (yeso)? No Goodbye

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!