Jun-24-2018, 05:30 PM
(This post was last modified: Jun-24-2018, 05:30 PM by gontajones.)
Quote:for month in range(months): borrowed -= repayment borrowed *= (1 + interest / 12) print(borrowed)With a little cleaning and some proper variable names the for loop is perfectly clear, but I do respect wanting to clean up code. I like my code neat too, but never at the cost of speed. Try it for yourself. Run both for 100K months.
I completely agree with you. But maybe a beginner would read this and ask why the 'month' ('m' in my case) variable exists.