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

PS5 Part 3 Filtering My code was the same as Problem set solution except I did not put in break Not why break is necessary? I will post code

OpenStudy (anonymous):

code attached

OpenStudy (anonymous):

Sorry Q should have read: PS5 Part 3 Filtering My code was the same as Problem set solution except I did not put in break Not sure why break is necessary?

OpenStudy (anonymous):

a break is necessary because it completes the code

OpenStudy (anonymous):

Thanks bookworm What would happen without break? Intuitively I would want this loop to keep going adding more stories to interesting stories I have not used break in any of my programs so far so struggling with concept

OpenStudy (microbot):

break just "kicks" you out of the loop.

OpenStudy (anonymous):

Once again Thanks MicroBot So for each story once a trigger is found it adds story to interesting story list and moves on to next story So it does not look for further triggers in story that would (if found) add repeated stories to Interesting story list. Am I correct?

OpenStudy (microbot):

yes but this looks like a typo you have.Dont know if it gives you errors. interstingStories.append(story) ##inter*e*stingStories xD

OpenStudy (microbot):

and: return interestingstories ### return interesting*S*tories btw use this site to paste you codes as its easier to see it without having to download any files and open python and and and.: http://pastebin.com

OpenStudy (anonymous):

Thanks Will try to give it a go

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!