diff --git a/README.md b/README.md index b103466..baed411 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,4 @@ Output simple interest = p*t*r ``` -_© 2022 XYZ, Inc._ +_© 2025 XYZ, Inc._ diff --git a/simple_intrest.py b/simple_intrest.py new file mode 100644 index 0000000..ae3b2ef --- /dev/null +++ b/simple_intrest.py @@ -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)))