Simple python program to calculate compound interest. In this program, we can calculate compound interest in python using the formula of compound interest for beginners to understand the concept.
Principal Amount Definition in Python
The primary amount of a home loan is the amount borrowed from the lender at the outset, and it can also refer to the amount still outstanding when the loan is repaid.
Mathpow() in Python
The pow() method in Python returns the power of two values. x**y is computed with this function. This function computes the power after converting its parameters to float.
As in base exponent, the base and exponent are in the decimal numeral system, and the pow() function returns the base to the exponent power. Use pow() as Math because it is a static function of Math. rather than a method of a Math object you developed, use pow(). By using mathpow() we have executed the python program to calculate compound interest.
Python Program to Calculate Compound Interest
def co_in(principle, rate, time): Amount = principle * (pow((1 + rate / 100), time)) CI = Amount - principle print("CI", CI) co_in(100000, 10.00, 2)