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 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

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_2

Step: 3

blur-text-image_3

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

In what ways does quality affect cost?

Answered: 1 week ago

Question

8-2 What is the business value of security and control?

Answered: 1 week ago

Question

7. Discuss the implications of a skill-based pay plan for training.

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago