anonymous
  • anonymous
I need some help with this piece of code! month=0 debt=5,000 payment=100 interest=73.50 while month<12: debt -= payment debt -= interest print debt It is telling me that -= is not valid. What am I doing wrong.
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
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.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
Read the error message the interpreter is giving you closely. The clue you need is in there.
rsmith6559
  • rsmith6559
debt = 5,000 # wrong debt = 5000 # right
anonymous
  • anonymous
a la python shell you are creating a tuple and then trying to += (concatenate) an int to it >>> debt=5,000 >>> debt (5, 0) >>> debt+=100 Traceback (most recent call last): File "", line 1, in debt+=100 TypeError: can only concatenate tuple (not "int") to tuple as rsmith said above, get rid of the ','

Looking for something else?

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

More answers

anonymous
  • anonymous
Don't forget that you never increase the value of month, your loop is endeless, never separate the numbers, only if they are floats. Remember also that, the interest are part of your payment, should be better if it looks like this: debt = debt - (payment+interest), that'll help if they ask you things like, total amount you paid.

Looking for something else?

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