📜  复利的Python程序

📅  最后修改于: 2022-05-13 01:56:56.644000             🧑  作者: Mango

复利的Python程序

复利公式:


例子:

Input : Principle (amount): 1200
        Time: 2
        Rate: 5.4
Output : Compound Interest = 133.099243
Python3
# 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.


输出:

Compound interest is 6288.946267774416

请参阅有关程序的完整文章以查找复利以获取更多详细信息!