Question: The 3rd image is this problem. The 4th image is the code that I got from this website. I ran it as it was(2nd image),



The 3rd image is this problem.
The 4th image is the code that I got from this website.

I ran it as it was(2nd image), and I got an error like the first image. Please help me
56709 8 10 Exception has occurred: TypeError X expected string or bytes-like object 11 12 13 14 15 #Problem 1 (10 points): highlight (pattern, string) import re 16 17 def highlight (pattern, string): r = re.compile(pattern) File "C:\Users\parky\Desktop\CSE337 Assignment\cseise337_a02.py", line 10, in highlight if r.search(string) is not None : File "C:\Users\parky\Desktop\CSE337 Assignment\cseise337_a02.py", line 22, in print (highlight (p1, s2)) TypeError: expected string or bytes-like object 18 10 if r.search(string) is not None : res = = r.search(string).span() return string[:res[0]] + " " +string[res[1]:] else : return None = r' [a-zA-Z]\d' S = "ShepardN7" print (highlight(p,s))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
