日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

python计算连续复利_复利的Python程序

發(fā)布時間:2023/12/14 50 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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)T

Where,

哪里,

  • 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.99999999994

Python程序找到復(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)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。