I can't even get past the first problem set. I try to set raw_input variables to input the credit card data, and then I set additional variables that take that data and do the mathematical operations. After that I do a for loop until 12. I know I am doing something gravely wrong, and I need someone who is better at this to help give me a basic structure of a program.
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.
Why not post what you have so we can help find and fix the errors?
Just a guess, but: raw_input() returns character data. If you want numbers, like an interest rate, you'd need to:
interestRate = float( raw_input( "Enter interest rate: " ) )
if( interestRate > 1.0 ):
interestRate = interestRate / 100.0
Excuse me for not being clearer earlier, I was not certain of this format has a character limit or anything. At any rate, I will post what code I have, and yes, I am aware this is terribly wrong. It's also not complete.
outstanding_balance=raw_input("What is your outstanding balance?")
annual_interest=raw_input("What is your annual interest rate?")
min_monthly=raw_input("What is the minimum monthly repayment rate?")
mmp = min_monthly * outstanding balance
pp = mmp - anaual_interest/12 * outstanding_balance
rb = outstanding_balance - pp
for months in year:
My thinking was using a for loop to cycle through the 12 months, and then at every iteration (1 month), print out the variables which would take the input data and calculate it.
Not the answer you are looking for? Search for more explanations.
Well, what rsmith pointed out is an issue.
`outstanding_balance=raw_input("What is your outstanding balance?")`
That takes in TEXT. Computers see the text 10 and the number 10 differently. So you need to change it from text to numbers.
`outstanding_balance=float(raw_input("What is your outstanding balance? "))`
That would change is to a floating point number. int() would change it into a signed integer. The floats allow for decimals, so they help with things like interest, but are not super accurate. Binary representations of decimals end up with rounding issues. Integers, on the other hand, are wonderfully precise... but in computers you can't easily leave things in fractional form. They want 3/2 = 1, not 1.5, in computers thanks to how integers work. So you probably want floats here.