Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


Problem Set 1C and Practice Quiz 1 1-I wrote this code ( http://dpaste.com/hold/773969/ ) for Problem Set 1C and it doesn't give the same results that are shown in the test cases. However it gives the same results that the solution's code does. Any idea what is wrong in both? 2-Shouldn't this code ( http://dpaste.com/hold/773970/ ) print True twice? I printed x after the first and second loops and got 11.0 and 10.0. Can't understand why it prints False and True. Is it because 0.1 is not really 0.1 (it's a float)? 3- Does anyone have the answers for Practice Quiz 1?

  • one year ago
  • one year ago

  • This Question is Closed
  1. bwCA
    Best Response
    You've already chosen the best response.
    Medals 1

    2 - http://dpaste.com/774000/ 1 - at line 16 you probably should use something other than exactly zero for you conditional statement - maybe -0.05 < balance2 <= 0

    • one year ago
  2. Scotch
    Best Response
    You've already chosen the best response.
    Medals 0

    Did someone adequately answer your number 2 question? The links are dead so I can't see what the script was, but I assume it was similar to this: x = 10.0 for i in range(10): x += 0.1 print x, i print x print x == 11.0 print x for i in range(10): x -= 0.1 print x, i print x == 10.0 print x I also don't understand why I get a False. The print x above and below line 6 both say 11.0. Any help would be appreciated...

    • one year ago
    • Attachments:

See more questions >>>

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


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