A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 4 years ago

Sorry for all the questions! In the first problem, "Credit Card Debt," how would one find the total principle paid? I know that in the program below, it is all the values of r added up, but I can't figure out how to deal with it in each separate time it loops.

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

    ## Calculate balance for compound interest. x = float(raw_input('Enter current balance ')) y = float(raw_input('Enter annual interest rate ')) z = float(raw_input('Enter minimum monthly payment rate ')) for ans in range(1,13): t = x * z p = (y/12.0) * x r = t - p x = x - r print 'Minumun monthly payment ', t print 'principle paid ', r print 'remaining balance ', x print 'Total principle paid ', ~blank spot...~ print 'Balance ', x

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

    Total principle paid, start with a var outside your loop. So after you ask the user to input their x, y and z, name a new var and make it equal to 0. a = 0 in the loop, you do something like a = a + r and then at the end when you are printing your results, you just print var a. I think this should get you your total principle paid over 12 months

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


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