Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago

Question

1. Who will you assemble on the team?

Answered: 1 week ago

Question

Did the team members feel that their work mattered

Answered: 1 week ago