Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I would be grateful for some help with the following Python question in relation to string manipulation. Thanks This question tests your ability to

Hi, I would be grateful for some help with the following Python question in relation to string manipulation. Thanks

This question tests your ability to manipulate strings. A palindromic word is one that reads the same backwards as forwards. Hence the words hello and peel are not palindromes, but the words peep, deed and dad are palindromes. (a) Create a class called Palindrome.

(b) In your Palindrome class, create a method called reverse() which takes a string argument. Your method should return the reverse of the argument as a string. For example, if the argument is Foobar then your method should return rabooF.

(c) Create a second method in Palindrome called isPalindrome() which takes a string argument. This method should return True if the argument is a palindrome and False otherwise.

(d) Write some code to test your new Palindrome class and print out results of your testing to the user. Give some consideration to what sort of strings you might want to use for your testing.

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago