Quantcast

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

MakaiMcClintock Group Title

Need help debugging the second problem of PSet1

  • one year ago
  • one year ago

  • This Question is Closed
  1. MakaiMcClintock Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    My code is producing no output and i can't figure out why. Thanks in advance! ## Problem Set 1, Problem 2 outstandingBalance = float(raw_input("Please enter the outstanding balance on the card: ")) interestRate = float(raw_input("Please enter the annual interest rate on the card: ")) monthlyInterestRate = interestRate/12.0 initialBalance = outstandingBalance paymentAmount = 0 monthsRequired = 1 while paymentAmount<=outstandingBalance: print ("here1") paymentAmount = paymentAmount+10 monthsRequired=1 outstandingBalance = initialBalance while monthsRequired<=12 and outstandingBalance>0: print ("here2") outstandingBalance = outstandingBalance * (1+monthlyInterestRate)-paymentAmount monthsRequired = monthsRequired +1 if outstandingBalance<0: print ("Monthly payment to pay off debt in 1 year: " + str(paymentAmount)) print ("Number of months needed: " + str(monthsRequired)) print ("Balance: " + str(outstandingBalance))

    • one year ago
  2. e.mccormick Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Can you use on of the code posting services, like the one on github or pastebin? See, if I copy your code from here, it will remove all formatting and I will have to edit the code just to try it and look for errors. =/ I see you have a lot of test prints in there, and by no output I assume you mean it never even does those. If so, then it is not even getting to the start of the loop, which is odd.

    • one year ago
  3. e.mccormick Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Hmmm.... What version of Python are you using and did you save the file as a .py?

    • one year ago
    1 Attachment
  4. genius12 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    are most ppl in the compsci section practising python?

    • one year ago
  5. e.mccormick Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Mechanical Mooc is starting their new round of Python class... so it drives up the Python business.

    • one year ago
  6. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    add more print statements like this maybe http://dpaste.com/1249318/

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

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.