Skip to content
Related Articles

Related Articles

Python Program for simple interest

View Discussion
Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 16 Jun, 2022
View Discussion
Improve Article
Save Article

Simple interest formula is given by: Simple Interest = (P x T x R)/100 Where, P is the principle amount T is the time and R is the rate

Examples:

EXAMPLE1:
Input : P = 10000
        R = 5
        T = 5
Output :2500.0
We need to find simple interest on 
Rs. 10,000 at the rate of 5% for 5 
units of time.

EXAMPLE2:
Input : P = 3000
        R = 7
        T = 1
Output :210.0

Python3




# Python3 program to find simple interest
# for given principal amount, time and
# rate of interest.
 
 
def simple_interest(p,t,r):
    print('The principal is', p)
    print('The time period is', t)
    print('The rate of interest is',r)
     
    si = (p * t * r)/100
     
    print('The Simple Interest is', si)
    return si
     
# Driver code
simple_interest(8, 6, 8)

Output:

The principal is 8
The time period is 6
The rate of interest is 8
The Simple Interest is 3.84

Time complexity: O(1)

Auxiliary Space: O(1)

#Please refer complete article on Program to find simple interest for more details!

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!