Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

andrew.m.higgs

  • 2 years ago

So how many of you got caught with the ceiling_test? It took me a while to figure out why my answer was 1 less than it should be. :-)

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

    my answer is not the totally correct one and I've not figured out why - but since I'm horrible at math, I'm not surprised.

  2. andrew.m.higgs
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Yeah. Maths is definitely not my strong point....

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

    I'm curious what approach you used to finally resolve. There are two problems with the write-up of part 2. The first is that there is no "ceiling" function. The second is that the test cases supplied explicitly use integer division.

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

    There is a math.ceil function if you import math (http://docs.python.org/2/library/math.html) so you can use that. I had a hard time getting the order correct in the variable to get it to get the right answer when using my multiadd function.

  5. andrew.m.higgs
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Yes, as Susan says there is a math.ceil function. I simply divided by 19.0 so it returns a float. It took quite a while for me to spot that I was exactly 1 out. :-)

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

    • 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.