Question
Please You Must Use Python Please read the prompt carefully and the program has to fix with different output right below Objective: To examine a
Please You Must Use Python
Please read the prompt carefully and the program has to fix with different output 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:
[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:
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started