Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 15 Online
OpenStudy (anonymous):

from string import* def countSubStringMatch(target,key): "count the number of the key string in the target" targetone=target+"@" answer=find(target,key) number=0 if answer<0: print number else: i=answer number=1 while i<=find(targetone,"@"): answer=find(target,key,i) if answer<0: break else: i=answer+1 number=number+1 print number-1 is this code recursive or iterative?

OpenStudy (anonymous):

Your function isn't calling itself, so that would make it iterative.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!