hi guys, I have a problem in assignment 3 problem 3 here is the code http://codepad.org/EKmnOwLX I am getting error for line 14. Tuple and list they are still confusing to me especially when it comes to accumulating the result in one.
It is the way you are trying to add to a tuple. Try changing it to this: ans += (firstMatch[i], )
I actually had a lot of trouble with this problem. My question/thread can be found here: http://openstudy.com/groups/mit+6.00+intro+computer+science+%28ocw%29#/groups/mit+6.00+intro+computer+science+%28ocw%29/updates/4e8ffd6d0b8bfb9f23dd90f7
Thanks I've done i think the problem but just wanted that someone can check I think this is correct now, can you check http://codepad.org/zIAcsEvm
I tested it out with a silly target/key that I used for mine and it looks good to me! test can be seen here: http://codepad.org/pKVIcdAb Good job!
Thanks. I don't know if you will agree or not but if would be great if they had provided an example output also especially for this sort of confusing problem.
Example output would have been much appreciated, but at least we can come here and get help/people to look over our work.
Yep this is group is a great help so far and hope in future also.
http://codepad.org/5PZXB0VS Here's a testSuite() for you to use on this problem. I ran it and got an error, so there's a little something for you to fix. Also, since subStringMatchOneSub() has a lot of debug print statements in it, you might want to comment them out. And if a test passes, it doesn't print anything. So if you run it and don't see any output, congrats!
I've made some required changes in the given code now it is working fine as far as I can guess because testSuite() is working now without any error and returning values for all the combinations as given. Please let me know if still there is any error or bug http://codepad.org/rhFQpwgF
http://codepad.org/WKHMri9m I tweaked the test() function a little bit, put my key14 in (so the expected output would match), and commented out the print statements in the function, and now there's no output. Success! I changed the order of the parameters for subStringMatchOneSub() because they're backwards from the rest of the functions in this problem. I don't know why they did that.
Join our real-time social learning platform and learn together with your friends!