So I am working with recursion,
The problem is:
" Good(43) Morning"
I have to use recursion to print all the information inside parenthesis like this: "(43)"
My code so far is:
def extractor(myString):
if len(myString) == 0:
return ""
if myString[0] == "(":
return myString[0]
if myString[0] == ")":
return myString[:]
else:
return extractor(myString[1:])
I can only get parenthesis. How could I change it?