From 61950f49f07e80f74db52591c107612374564e29 Mon Sep 17 00:00:00 2001 From: VatsalRangoonwala Date: Thu, 9 Jan 2025 19:59:16 +0530 Subject: [PATCH 1/2] Create test.md --- test.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.md diff --git a/test.md b/test.md new file mode 100644 index 0000000000..fb352860c6 --- /dev/null +++ b/test.md @@ -0,0 +1 @@ +only for testing From ed1649918d35545065b5a021a59b25949ed2d218 Mon Sep 17 00:00:00 2001 From: VatsalRangoonwala Date: Thu, 9 Jan 2025 20:01:59 +0530 Subject: [PATCH 2/2] Update and rename test.md to fix.py --- fix.py | 26 ++++++++++++++++++++++++++ test.md | 1 - 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 fix.py delete mode 100644 test.md diff --git a/fix.py b/fix.py new file mode 100644 index 0000000000..5a88fd66e9 --- /dev/null +++ b/fix.py @@ -0,0 +1,26 @@ + +# This script calculates yearly compound interest given principal, annual rate of interest and time period in years. +# Do not use this in production. Sample purpose only. + +# Author: Upkar Lidder (IBM) + +# Input: +# p, principal amount +# t, time period in years +# r, annual rate of interest + +# Output: +# compound interest = p * (1 + r/100)^t + + +def compound_interest(p, t, r): + return p * (pow((1 + r / 100), t)) + + +if __name__ == "__main__": + p = float(input("Enter the principal amount: ")) + t = float(input("Enter the time period: ")) + r = float(input("Enter the rate of interest: ")) + + print("The compound interest is {:.2f}".format(compound_interest(p, t, r))) + diff --git a/test.md b/test.md deleted file mode 100644 index fb352860c6..0000000000 --- a/test.md +++ /dev/null @@ -1 +0,0 @@ -only for testing