Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

Need help debugging the second problem of PSet1

MIT 6.00 Intro Computer Science (OCW)
See more answers at
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly


Get your free account and access expert answers to this and thousands of other questions

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))
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.
Hmmm.... What version of Python are you using and did you save the file as a .py?
1 Attachment

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

are most ppl in the compsci section practising python?
Mechanical Mooc is starting their new round of Python class... so it drives up the Python business.
add more print statements like this maybe

Not the answer you are looking for?

Search for more explanations.

Ask your own question