diff --git a/compundinteger.py b/compundinteger.py new file mode 100644 index 0000000..217bb79 --- /dev/null +++ b/compundinteger.py @@ -0,0 +1,21 @@ +# Python3 program to find compound +# interest for input taking from user. + + +def compound_interest(principal, rate, time): + + # Calculates compound interest + Amount = principal * (pow((1 + rate / 100), time)) + CI = Amount - principal + print("Compound interest is", CI) + + +# Driver Code +#Taking input from user. +principal = int(input("Enter the principal amount: ")) +rate = int(input("Enter rate of interest: ")) +time = int(input("Enter time in years: " )) +#Function Call +compound_interest(principal,rate,time) + +#This code is contributed by Vinay Pinjala.