Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please You must use Python Please read the prompt carefully and the program has to fix different output like right below. Objective: To examine a

Please You must use Python

Please read the prompt carefully and the program has to fix different output like right below.

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:

 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 

Requirements:

Your program should have at least 2 functions, including a main() function (no global variables or global code other than a call to main within an if-statement)

Your program should ask the user if they want to enter another word, and if the user types "yes" or "y", upper or lower case, then the program should repeat.

Your program should handle mixed-case input for palindromes such as shown in the above example (convert all strings to lower case in your code, to make this easy)

Every function (except main) needs to have a comment in a triple-quoted string at the beginning, briefly explaining what it does.

Test your program with all of the above test cases.

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

2. What additional techniques might be used to assess talent?

Answered: 1 week ago