Skip to main content

Posts

Showing posts with the label mortgage

Python - Mortgage EMI Calculator

🐍  Using Python, write a program to calculate the monthly payments of a mortgage at a given interest rate. Also figure out how long it will take the user to pay back the loan. For added complexity, add an option for users to select the compounding interval (Yearly, Bi-Yearly, Quarterly, Monthly, Weekly, Daily) Solution def emicalculator(loan, interest, interval, emi):     day_count = 0     remaining = loan     if interval[0].lower()=='d':         while remaining > 0:             day_count += 1             remaining += (interest/100)*remaining             if day_count%30==0:                 remaining -= emi                 if remaining>=loan:                     print('Either lower interest rate or increase EMI...