'bal=float(raw_input("what is your credit card balance?") ans=float(raw_input("And you annual interest rate?") mpr=float(raw_input("How about your minimum monthly payment rate?") month=0 while (month<12): mpr*bal=mmp (ans/12)*bal=ipm mmp-ipm=ppm bal-ppm=rmb print(month) print("your minimum monthly payment is", mmp) print("Your remaining balance is", rmb) print("Your principal paid this month is", ppm)' problem set 1 help please?
This is my code beginning. idk whats wrong i feel like I'm giving it the right instructions but i know its my error not the computers ):
for one, I'm pretty sure you want the variables getting assigned things to be on the left of the = assignment
what you're doing is 5=x instead of x=5
Im confused. its reading me a syntax error and highlighting the second variable listed here as 'ans'. 'ans' is the variable i want and i want it equal to whatever the user inputs for their annual interest rate. I see that further down i put the variable on the right, thank you for that insight as it would have went unnoticed. But I'm not sure where the error is in the second line.
I don't know python so I can't address syntax. instead of ``` mpr*bal=mmp (ans/12)*bal=ipm mmp-ipm=ppm bal-ppm=rmb ``` try ``` mmp=mpr*bal ipm= (ans/12)*bal ppm=mmp-ipm rmb=bal-ppm ```
Just a hunch.. maybe you need to use single quotes instead of double quotes after raw_input.. though I'm really unsure- I don't know much of python.
I just figured it out. in the first three lines i didn't close with two end parentheses i only use one so it was catching it up. thanks for the help guys
bal=float(raw_input("what is your credit card balance?")) air=float(raw_input("And you annual interest rate?")) mpr=float(raw_input("How about your minimum monthly payment rate?")) month=1 while (month<13): mmp=mpr*bal ipm=(air/12)*bal ppm=mmp-ipm rmb=bal-ppm print('month' month) print("your minimum monthly payment is" mmp) print("Your remaining balance is" rmb) print("Your principal paid this month is" ppm) month+= 1 This is my final code and there is a problem with the loop. It loops back the 12 months like i want but it gives me the same statistics for every month so I'm under the impression that i need to add another increment change but I'm not certain what exactly
Maybe update the balance to equal rmb at the end of each loop (iteration)?
i did, and my script is up and running thanks again. it really helps when you're teaching yourself to have other people to consult with.
that's for sure :) it's cool that I can help even if I don't know python. -java student
Join our real-time social learning platform and learn together with your friends!