Python Program to Calculate Simple Interest

In this example, we will write a simple program that calculates the simple interest in Python. To better understand this example, make sure you have knowledge of the following tutorials:-

Let us have a look at the formula for calculating the simple interest.

Simple Interest = (P x T x R) / 100
Where,
P is the principal amount
T is the time in years and
R is the rate of interest

Source Code:

The output of the above program is:-

Enter the principal amount: 100000
Enter the time in years: 1
Enter the interest rate: 12
Simple Interest = 12000.00
In this program, the user input is taken using input() function which takes input as a string. But as we are doing the calculation part, we need the input to be a float. So, we did the type-conversion using float() function.
The input from the user is taken as p for the principal amount, t for the time in years and r for the interest rate. The mathematical formula for simple interest is applied and the result is displayed using print () function.
SHARE Python Program to Calculate Simple Interest

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Share