python计算连续复利_复利的Python程序
生活随笔
收集整理的這篇文章主要介紹了
python计算连续复利_复利的Python程序
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
python計算連續(xù)復(fù)利
Given principle amount, rate and time and we have to find the compound interest in Python.
給定原理量,速率和時間,我們必須找到Python的復(fù)利 。
計算復(fù)利 (Calculate compound interest)
To calculate compound interest, we use the following formula,
要計算復(fù)利,我們使用以下公式,
P(1 + R / 100)TWhere,
哪里,
P – Principle amount
P –本金
R – Rate of the interest, and
R –利率,以及
T – Time in the years
T –歲月
Example:
例:
Input:p = 250000r = 36t = 1# formulaci = p * (pow((1 + r / 100), t)) print(ci)Output:339999.99999999994Python程序找到復(fù)利 (Python program to find compound interest)
# Python program to find compound interest p = float(input("Enter the principle amount : ")) r = float(input("Enter the rate of interest : ")) t = float(input("Enter the time in the years: "))# calculating compound interest ci = p * (pow((1 + r / 100), t)) # printing the values print("Principle amount : ", p) print("Interest rate : ", r) print("Time in years : ", t) print("compound Interest : ", ci)Output
輸出量
First run: Enter the principle amount : 10000 Enter the rate of interest : 3.5 Enter the time in the years: 1 Principle amount : 10000.0 Interest rate : 3.5 Time in years : 1.0 compound Interest : 10350.0Second run: Enter the principle amount : 250000 Enter the rate of interest : 36 Enter the time in the years: 1 Principle amount : 250000.0 Interest rate : 36.0 Time in years : 1.0 compound Interest : 339999.99999999994翻譯自: https://www.includehelp.com/python/program-for-compound-interest.aspx
python計算連續(xù)復(fù)利
總結(jié)
以上是生活随笔為你收集整理的python计算连续复利_复利的Python程序的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用quaggaJS识别图片中的条形码
- 下一篇: 第87篇ES之Elastica-php匹