Learnitweb

Python program to calculate simple interest

Simple interest formula is given by:

Simple Interest = (P x T x R)/100

Here, P stands for Principal, T stands for Time and R stands for Rate of Interest

In the following example, we’ll use principal and rate of interest as float values and time as int value just for the sake of simplicity.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# A simple Python3 program to calculate
# Simple Interest based on user input.
p = float(input("Please provide Principal: "))
r = float(input("Please provide Rate of Interest: "))
t = int(input("Please provide Time: "))
si = (p * t * r)/100
print('The Simple Interest is', si)
# A simple Python3 program to calculate # Simple Interest based on user input. p = float(input("Please provide Principal: ")) r = float(input("Please provide Rate of Interest: ")) t = int(input("Please provide Time: ")) si = (p * t * r)/100 print('The Simple Interest is', si)
# A simple Python3 program to calculate 
# Simple Interest based on user input. 
  
p = float(input("Please provide Principal: "))
r = float(input("Please provide Rate of Interest: "))
t = int(input("Please provide Time: ")) 

si = (p * t * r)/100
      
print('The Simple Interest is', si)

Output

Please provide Principal: 1000
Please provide Rate of Interest: 10
Please provide Time: 1
The Simple Interest is 100.0