Answered step by step
Verified Expert Solution
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
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 palindromeStep 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