Python program to calculate simple interest

Python program to calculate the simple interest using user provided values :

In this tutorial, we will learn how to calculate simple interest in python using the values entered.
The following formula is used to calculate simple interest value :

python simple interest

The program will ask the user to enter all three values first. It will then calculate the simple interest and print out the result.

Python program :

You can find the code for the below program here.

python find simple interest

Explanation :

The commented numbers in the above program denote the step numbers below :

1. Take the user input for the principal amount, time to calculate the simple interest in years and rate of interest. We are reading the input using input() method and then converting it to a floating point number using float().
The principal amount is stored in the variable P, the number of years in N and the rate of interest in R.
2. Now, calculate the simple interest using the same formula we mentioned at the starting of the program. Finally, print it out. We are using {} and .format() to print out the final result.

Sample Output :

python find simple interest

Conclusion :

In this tutorial, we have learned how to find out simple interest using user-provided values. Try to run the example above and drop one comment below if you have any queries.

You might also like :

Leave a Reply