Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in python on mimir To complete this exercise, change the body of the following function so that it returns a palindrome - a string that

image text in transcribed

in python on mimir

To complete this exercise, change the body of the following function so that it returns a palindrome - a string that reads the same backwards as forwards- of your choice. The palindrome has to be at least 2 letters long! In [ ]: def my_palindrome (): Graded return After completing the implementation, you can run the following test cell by selecting it and hitting Shift-Enter (hold down the Shift key and hit Enter ). If all tests pass, you'll see no output. Otherwise, check out the error shown, fix your implementation, and run the test cell again. Read Only In [10]: pal = my_palindrome) assert isinstance(pal, str), "Must return a string assert pal.strip), 'String should not be empty assert len(pal) > 1, 'String should be at least 2 letters long' assert pal == pal[::-1], 'String is not a palindrome

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

More Books

Students also viewed these Databases questions

Question

=+Describe an important trade-off you recently faced

Answered: 1 week ago