{"id":16524,"date":"2021-08-12T09:33:34","date_gmt":"2021-08-12T04:03:34","guid":{"rendered":"https:\/\/python-programs.com\/?p=16524"},"modified":"2021-11-22T18:38:29","modified_gmt":"2021-11-22T13:08:29","slug":"python-program-to-calculate-emi","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-calculate-emi\/","title":{"rendered":"Python Program to Calculate EMI"},"content":{"rendered":"
In the previous article, we have discussed Python Program to Check if a String is Lapindrome or Not<\/a> EMI is an abbreviation for Estimated Monthly Installment. It is a set amount of money paid by the customer or borrower to the bank or lender on a set date each month of the year. This amount is deducted from the customer’s or borrower’s account every month for a set number of years until the loan is fully paid off by the customer or borrower to the bank or lender.<\/p>\n Formula :<\/strong><\/p>\n EMI = (P*R*(1+R)T<\/sup>)\/((1+R)T<\/sup>-1)<\/strong><\/p>\n where P = Principle<\/p>\n T = Time<\/p>\n R = Rate of interest.<\/p>\n Given principle, Rate, Time, and the task are to calculate EMI for the given input values in Python<\/p>\n Examples:<\/strong><\/p>\n Example1:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Example 2:<\/strong><\/p>\n Input:<\/strong><\/p>\n Output:<\/strong><\/p>\n Below are the ways to Calculate BMI for given values of principle, Rate, Time.<\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n Approach:<\/strong><\/p>\n Below is the implementation:<\/strong><\/p>\n Output:<\/strong><\/p>\n Explore more instances related to python concepts from\u00a0Python Programming Examples<\/a>\u00a0Guide and get promoted from beginner to professional programmer level in Python Programming Language.<\/p>\n In the previous article, we have discussed Python Program to Check if a String is Lapindrome or Not Estimated Monthly Installment (EMI): EMI is an abbreviation for Estimated Monthly Installment. It is a set amount of money paid by the customer or borrower to the bank or lender on a set date each month of …<\/p>\n
\nEstimated Monthly Installment (EMI):<\/strong><\/p>\nGiven Principle = 10000\r\nGiven Rate = 8\r\nGiven Time = 2<\/pre>\n
The EMI for the above given values of P,T,R = 452.2729145618459<\/pre>\n
Given Principle = 20000\r\nGiven Rate = 15\r\nGiven Time = 3<\/pre>\n
The EMI for the above given values of P,T,R = 693.3065700838845<\/pre>\n
Program to Calculate EMI<\/h2>\n
\n
Method #1: Using Mathematical Formula (Static input)<\/h3>\n
\n
# Give the Principle as static input and store it in a variable.\r\ngvn_princpl = 10000\r\n# Give the Rate as static input and store it in another variable.\r\ngvn_rate = 8\r\n# Give the Time as static input and store it in another variable.\r\ngvn_time = 2\r\n# Calculate the given rate using given rate formula( given rate\/(12*100))and\r\n# store it in a same variable.\r\ngvn_rate = gvn_rate\/(12*100)\r\n# Calculate the given time using given time formula (given time *12) and\r\n# store it in a same variable.\r\ngvn_time = gvn_time*12\r\n# Calculate the EMI Value using the above given mathematical formula and\r\n# store it in another variable.\r\nfnl_Emi = (gvn_princpl*gvn_rate*pow(1+gvn_rate, gvn_time)) \/ \\\r\n (pow(1+gvn_rate, gvn_time)-1)\r\n# Print the given EMI value for the above given values of Principle,Rate,Time.\r\nprint(\"The EMI for the above given values of P,T,R = \", fnl_Emi)\r\n<\/pre>\n
The EMI for the above given values of P,T,R = 452.2729145618459<\/pre>\n
Method #2: Using Mathematical Formula (User input)<\/h3>\n
\n
# Give the Principle as user input using float(input()) and store it in a variable.\r\ngvn_princpl = float(input(\"Enter some random number = \"))\r\n# Give the Rate as user input using float(input()) and store it in another variable.\r\ngvn_rate = float(input(\"Enter some random number = \"))\r\n# Give the Time as user input using float(input()) and store it in another variable.\r\ngvn_time = float(input(\"Enter some random number = \"))\r\n# Calculate the given rate using given rate formula( given rate\/(12*100))and\r\n# store it in a same variable.\r\ngvn_rate = gvn_rate\/(12*100)\r\n# Calculate the given time using given time formula (given time *12) and\r\n# store it in a same variable.\r\ngvn_time = gvn_time*12\r\n# Calculate the EMI Value using the above given mathematical formula and\r\n# store it in another variable.\r\nfnl_Emi = (gvn_princpl*gvn_rate*pow(1+gvn_rate, gvn_time)) \/ \\\r\n (pow(1+gvn_rate, gvn_time)-1)\r\n# Print the given EMI value for the above given values of Principle,Rate,Time.\r\nprint(\"The EMI for the above given values of P,T,R = \", fnl_Emi)\r\n<\/pre>\n
Enter some random number = 20000\r\nEnter some random number = 15\r\nEnter some random number = 2.5\r\nThe EMI for the above given values of P,T,R = 803.5708686652767<\/pre>\n
\n