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

PS3,Q2: The goal is to find the locations of a key string in a target string and then print these locations as a tuple. My code seems to be working. However, I'm curious if there is alternative way to create the locations found as a tuple. I chose to create an iterative function that stored the found locations as a list and then converted the list into a tuple at the end. Any thoughts on a better method? http://codepad.org/RGHYVQy7

OpenStudy (maitre_kaio):

Here is my solution, where I manipulate tuples all the way: http://codepad.org/ENMqLhEQ

OpenStudy (anonymous):

Thanks.

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!