I am stuck on my python lab from this week. The lab deals with strings and being able to search them, slice them, etc. The part I'm stuck on is as follows:
"You will implement in Python a function matchPat. It will take two arguments, a pattern string and a string, and return a Boolean, which indicates whether or not the pattern matches the initial portion of the string. A wild-card match is represented by an asterisk(*). HINT: You should express the algorithm recursively. Again, a good place to start is nesting the structural pattern. For the wild card, try to translate "zero or more characters" into code. Both logical operators and and or are useful."
So basically, I know where to start and what to do for the code itself, what I am having trouble doing is figuring out how to get the * to match "zero or more characters."
A few quick examples to make the question clear:
This code must be done recursively using if statements and can not include the integrated python function 'in'.