Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello , I got stuck on rewrite this function. so I've been asked write a new function Check_ispal(word) that takes a string input (word) and:

Hello , I got stuck on rewrite this function.

image text in transcribed

so I've been asked write a new function Check_ispal(word) that takes a string input (word) and: (a) strips all non-alphanumeric characters (that is, all characters that are not lowercase/uppercase letters or numbers), from word, then (b) converts all uppercase letters in word to lowercase letters and finally, (c) calls ispal() (the one defined in the previous page) with the modified word string. So, when called this way: Check_ispal("A man, a plan, a canal: Panama"), it returns True, and Check_ispal("A Santa at NASA"), also returns True, and Check_ispal("Yawn... Madonna fan? No dann way!!"), also returns True.

the beginning of the function is given

image text in transcribed

thank you for your help !

def spal (Myst r): if len(MyStr)2: if MyStr[0] !- MyStr[-1]: else: return True return False return ispal (MyStr[1:-1]) def Check-spal(word): print (word, end-":") newword for c in word

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

What is the Consumer Credit Counseling Services (CCCS)?

Answered: 1 week ago

Question

List the ten steps in the accounting cycle

Answered: 1 week ago

Question

Describe the new structures for the HRM function. page 676

Answered: 1 week ago