av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

Python程序:計(jì)算簡(jiǎn)單利息

創(chuàng)新互聯(lián)Python教程:

在這個(gè)簡(jiǎn)單的 python 程序中,我們需要找到簡(jiǎn)單的興趣。這是一個(gè)中級(jí) python 程序。

要理解這個(gè)例子,您應(yīng)該了解以下 Python 編程主題:

  • Python 語法
  • Python 安裝和設(shè)置
  • Python 運(yùn)算符

什么是單純的興趣?

在這個(gè)求解好的 python 程序中,我們需要計(jì)算 Simple Interest,可以用公式 SI = pnr / 100 來計(jì)算。在哪里

  • p 為本金金額。
  • n 為年數(shù)。
  • r 為利率。

例如,假設(shè)我們以 10%的利率貸款 1000 英鎊,期限為 1 年。然后通過公式 pnr/100 計(jì)算單利得出 1000 10 1 / 100 = 100。所以我們要給 100 盧比作為 1 年的利息。

python 中的單利是如何計(jì)算的?

現(xiàn)在在 python 編程語言中應(yīng)用這個(gè)邏輯。我們使用 python 語言中的input函數(shù)接受本金、利率和時(shí)間的值。然后我們用公式 ( p n r ) / 100 計(jì)算利息。

算法

STEP 1: 使用 python 語言的輸入函數(shù)接受本金金額、時(shí)間和利率的值。使用浮點(diǎn)和 int 數(shù)據(jù)類型將值轉(zhuǎn)換為整數(shù)。

第二步:用公式 (pnr) / 100 計(jì)算單利。

STEP 3: 使用 python 編程語言中的 print 語句打印簡(jiǎn)單興趣的值。

Python 源代碼

principle=float(input("Enter the amount :"))

time=int(input("Enter the years :"))

rate=float(input("Enter the rate :"))

si=(principle*time*rate)/100

print("The simple interest is:", si)

輸出

Enter the amount : 1000

Enter the year : 1

Enter the rate : 10

The simple interest is : 100

當(dāng)前名稱:Python程序:計(jì)算簡(jiǎn)單利息
轉(zhuǎn)載來于:http://uogjgqi.cn/article/dhgphjj.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營(yíng)咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流