Before getting into the code of calculating **Simple Interest** in Python, lets understand how simple interest is calculated.

## What is Simple Interest?

Simple Interest is the amount of interest charge that you need to pay to the bank when you borrow money from them (a loan). There are three important variables that you would need to understand when writing your python program.

**Principal Amount (P)**: Principal is the amount that you have borrowed from the bank or the base price of the good or service that you have purchased and applied for a loan. Example if you brought a mortgage for $75,0000 USD than this amount is your principal.**Interest Rate (R)**: Interest rate is the price you need to pay to the bank for the Principal (Loan Amount) you borrowed. This is usually calculate annually. Interest is calculate in percentage. Example for a mortgage loan of $750,000 USD if the internet rate is 10% for a year (annual interest) then you need to pay $75,000 interest every year.**No of days (N)**: This is the tenor of the loan amount that you and the counter party have agreed upon.

## Formula for Simple Interest

**Simple Interest** = **(****P** [Principal Amount] **X** **N** [No of days] **X** **R** [Interest Rate]**)** **/** **100**

## Python code for Simple Interest calculation: SimpleInterest.py

```
# This is a Python program to calculate
# Simple Interest for the inputted
# Principal Amount, Rate of Interest,
# and Time frame
# Formula: (P x N x R)/100
#
# author: Code2care.org
def simple_interest_function(principal_amount,time_period_in_years,rate_of_interest):
print("Python Program to calculate Simple Interest")
print("-------------------------------------------")
print("Entered Principal Amount: ", principal_amount)
print("Entered Time Period in Years: ", time_period_in_years)
print("Entered Rate of Interest: ",rate_of_interest)
#Formula for Simple Interest
simple_interest = (principal_amount * time_period_in_years * rate_of_interest)/100
print('-------------------------------------------')
print("Simple Interest Calculated: ", simple_interest)
simple_interest_function(750000, 1, 10)
```

**Output:**

```
Python Program to calculate Simple Interest
-------------------------------------------
Entered Principal Amount: 750000
Entered Time Period in Years: 1
Entered Rate of Interest: 10
-------------------------------------------
Simple Interest Calculated: 75000.0
```

#### Comments:

- Thank you for the detailed example! It was useful for me!
01 Oct 2020 16:10:18 GMT
- Further comments disabled!

**More Posts related to Python,**

- Set width and height for the label in tkinter
- pip get list of all outdated Python packages
- Python Program To Calculate Simple Interest (SimpleInterest.py)
- How to uninstall pip Python packages
- Python Hello World! Program with code example (snippet)
- tkinter - Hello World! Program
- Change the background of Tkinter label or text
- Check installed Python version in Windows, Linux & macOS
- Whats new in Python 3.10 Pre-release
- Calculate discount amount python code

**More Posts:**

- Android Emulator] ##KBD: Full queue, lose event Error Logs - Android
- PHP drag and drop file upload tutorial using dropzone.js - PHP
- Column Mode Editing in Notepad++ - NotepadPlusPlus
- Gmail Unable to upload because it is a folder or a package (like an application bundle or RTFD document) - HowTos
- Android Shared Preferences API tutorial - Android
- Notepad++ Dark Theme - NotepadPlusPlus
- Change Mouse Scrolling in Mac OS X - Mac-OS-X
- Android Studio java.net.NoRouteToHostException - Android-Studio
- Error : Invalid key hash.The key hash does not match any stored key hashes - Android
- JSON Schema and Hyper-Schema : JSON Tutorial - Json-Tutorial
- 'Edit Document' Requires a Windows Sharepoint Services-compatible application and Microsoft Internet Explorer 6.0 or higher - SharePoint
- Remove Trailing zeros BigDecimal Java - Java
- Android Studio : Connection Error : Failed to download patch file - Android-Studio
- Find Java JRE Installation location Mac OS X - Mac-OS-X
- Go to Line Number option in Windows Notepad - NotepadPlusPlus