Site icon TestingDocs.com

Python Program Calculate Simple Interest

Overview

Let’s write a Python Program to calculate simple interest in this tutorial. We will use the Python IDLE on the Windows operating system.

Calculate Simple Interest

Let’s understand the mathematical formula for simple interest.

interest = p * t * r / 100

Python Program

# Sample program to compute simple interest

principal = float(input(“Enter the principal amount := “))

# Read the principal amount from the user

time = float(input(“Enter the time in years := “))

# Read time from the user

roi = float(input(“Enter the rate of interest := “))

# Read the rate of interest from the user

simple_interest = (principal*time*roi)/100

# Formula for Simple Interest

print(“The Simple Interest is := “, simple_interest)  # print Simple Interest

Program Output

 

Python Tutorials

Python Tutorial on this website can be found at:

https://www.testingdocs.com/python-tutorials/

More information on Python is available at the official website:

https://www.python.org

 

Exit mobile version