From 25325722a98a32367f7b4f0e458715cd2c5d09b0 Mon Sep 17 00:00:00 2001 From: Himanshu Porwal <56030087+himanshu-17@users.noreply.github.com> Date: Fri, 8 Oct 2021 19:10:32 +0530 Subject: [PATCH] Create 2hp.py --- 2hp.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 2hp.py diff --git a/2hp.py b/2hp.py new file mode 100644 index 0000000..435ce7f --- /dev/null +++ b/2hp.py @@ -0,0 +1,14 @@ +# Python3 program to find compound +# interest for given values. + +def compound_interest(principle, rate, time): + + # Calculates compound interest + Amount = principle * (pow((1 + rate / 100), time)) + CI = Amount - principle + print("Compound interest is", CI) + +# Driver Code +compound_interest(10000, 10.25, 5) + +# This code is contributed by Abhishek Agrawal.