Question: 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.

Hello , I got stuck on rewrite this function. so I've been

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

asked write a new function Check_ispal(word) that takes a string input (word)

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

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!