Question: Need some help on writing this function in Python 3.6. The instructions are defined below, as well as restrictions. Any help or guidance is greatly

Need some help on writing this function in Python 3.6. The instructions are defined below, as well as restrictions. Any help or guidance is greatly appreciated!

Need some help on writing this function in Python 3.6. The instructions

Please provide assistance for completing this function. This program is being written in Python 3.6 A sample output to test that it is working is the string "go hang a salami, I'm a lasagna hog!" 1. def is palindxome(phrase): given a string named phrase, this function returns True if the string is a palindrome, and False otherwise (a) Function behavior: i. Given phrase, you must determine if the string is identical forwards and backwards, any non-letter characters like spaces and if we ignore upper/lowercase and punctuation ii. Adapt the loop from lecture, which assumes that the entered string is lower-case and does not contain non-letter characters ii. In each iteration of the loop you are adapting, you will need to write two more loops The first loop should increment j as long as index j in phrase is not a letter, we can determine if a single character is a letter by taking that letter and calling isalpha) on it, which will be True only if the character is a letter iv. The second loop should decrement (decrease) j as long as index j in phrase is not a letter v. Once the two loops have finished, you know that index i is a letter and index j is a letter. You can now compare them and perhaps make.adeision, or perhaps not. vi. Once you are sure the string is not a palindrome, you should return False. Once you are sure the string is a palindrome, return True You cannot use any function that removes or replaces characters from a string. We haven't learned these yet. i. i. You cannot use any function that reverses a string for you. ii. You should not assume that phrase is all lowercase. You can use the lowerO function to create a copy of phrase that is converted to all lowercase

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!