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

Hi all: Here is a working code for ps3a http://dpaste.com/hold/526101/ The code is working just fine, but I think the while loop may have some issue where in its going through more loop than necessary. Can someone look at this code and comment ? Thanks!!

OpenStudy (anonymous):

Notice that the condition on line 9 "location + len(key)" will break your program if the strings overlap: try with target = 'aaaaa' and key = 'aa'

OpenStudy (anonymous):

Interesting point, I have updated my code but did not think about this. So would this constitute 4 instances or 2 instances?

OpenStudy (anonymous):

Thanks!!

OpenStudy (anonymous):

http://dpaste.com/hold/526128/ Thanks!! I think this should be it.

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!