A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 4 years ago

I was wondering if anyone can check my solution to ps2 problem (McNuggets) I have been trying to get this optimized but am not sure I am handling it the right way. I am sure the output is correct so the program is working. http://pastebin.com/UbMe0MPj

  • This Question is Closed
  1. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    same thing but different - with for loops http://dpaste.com/696595/

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

    here is my solution to the finding prime number problem the only bug is it goes to -1 but im satisfied def prime(x, z): assert x> 0 assert z>= 0 while x > z: x = x-1 while x == 2 or x == 3 or x == 5 or x == 7 or x == 0: print x, 'is prime' x = x-1 if x%2==0 or x%3== 0 or x%5==0 or x%7==0: print x, 'is not prime' else: print x, 'is prime' if x is 0: print None return None

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

    here is my solution

    1 Attachment
  4. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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.