Working on Problem Set 1a. In the attached program, can someone walk me through why I don't get a "total paid over the 12 months". I get the last total paid instead...
@Neeco After commenting off the lines below you have to fill the line where you have written print 'Total amount paid: ' + str(round(,2)) In this case my advice would be to solve the problem with another variable named total_paid.Just create the floating point variable named total_paid and place befor the iteration(for loop) .Then write code like bellow between the code of for loop or iteration totlal_paid+=amountpaid Remember,that if you don't create the variable before the iteration then it will create a variable every time it iterates and thus will lose the previous assigned value of the variable.And at the end place the variable between the bracket like below.. print "Total amount paid'+str(round(total_paid)
@cracker_saba Thanks for the help! I was able to rewrite/simplify the program and completed it successfully. Now to figure out how to shorten the code in a way that still makes sense to me. The solution given makes sense and seems to be the shortest way... attached is the new program, refined and working properly.
Hahaha, I also noticed that I can't spell... Sorry for the typo's in the program...
Join our real-time social learning platform and learn together with your friends!