Programme to find the simple interest using Python


In this section of python coding, we will learn to calculate the simple interest. As we already know the mathematical expression to calculate the simple interest understand the code logic will be easier.

Programme to find the simple interest using Python

Let us look into the python code for calculating simple interest.


def interest(p, r, t):

    amount = float(p)

    rate = float(r)

    time = float(t)

    s_interest = float((amount*rate*time)/100)

    print("Simple interest of principle amount {0} , rate of interest {1} and time period {2} is {3}".format(amount,rate,time,s_interest))


# User input

p = input("Enter the principle amount: ")

r = input("Enter the rate of interest: ")

t = input("Enter the time period: ")



Programme to find the simple interest using Python Output


In the above code, we have created a function interest(). The user inputs for principal amount, rate and time period are scanned through input() function and passed to the function interest() for calculating the simple interest and then storing the result in the variable s_interest.


  • Barry Allen

    A Full Stack Developer with 10+ years of experience in different domain including SAP, Blockchain, AI and Web Development.

    View all posts


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.