Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Output
simple interest = p*t*r
```

2022 XYZ, Inc._
2025 XYZ, Inc._
24 changes: 24 additions & 0 deletions simple_intrest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This script calculates simple interest given principal, annual rate of interest and time period in years.
# Do not use this in production. Sample purpose only.

# Author: Ritik Kumar

# Input:
# p, principal amount
# t, time period in years
# r, annual rate of interest

# Output:
# simple interest = (p * t * r) / 100


def simple_interest(p, t, r):
return (p * t * r) / 100


if __name__ == "__main__":
p = float(input("Enter the principal amount: "))
t = float(input("Enter the time period (in years): "))
r = float(input("Enter the rate of interest: "))

print("The simple interest is {:.2f}".format(simple_interest(p, t, r)))