Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

SimpleSimon

  • 2 years ago

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

  • This Question is Open
  1. SimpleSimon
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    code attached

    1 Attachment
  2. SimpleSimon
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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?

  3. bookworm00981
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    a break is necessary because it completes the code

  4. SimpleSimon
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  5. MicroBot
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    break just "kicks" you out of the loop.

  6. SimpleSimon
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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?

  7. MicroBot
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

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

  8. MicroBot
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    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

  9. SimpleSimon
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks Will try to give it a go

  10. Not the answer you are looking for?
    Search for more explanations.

    Search OpenStudy
    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.