郭俞汝Python_Javascript網路執行_EXCEL_IRR二分法
郭俞汝解說影片
郭俞汝6/25截圖
以上所有程式碼
pmt = [0,0,0,0] #郭俞汝程式設計586設定串列list
pmt[0]=float(input('郭俞汝躉繳金額: '))#float轉換成實數float
for nper in range(1,4):
pmt[nper] = float(input('第'+str(nper)+'期回收: '))
def npv(rate):
y = - pmt[0]
for j in range(1,4):
y = y + pmt[j]/(1+rate)**j
return y
a, b, gap, f = 0.0, 1.0, 9.0, 9.0
maxerror = 0.000001
loopNumber = 1
while (gap > maxerror and abs(f) > maxerror and loopNumber < 100):
loopNumber+=1
c = (a+b)/2;
f = npv(c);
if ( abs(f) > maxerror and gap > maxerror):
if ( f>0 ):
a = c
else:
b = c
gap = b-a;
print('郭俞汝報酬率: ', c)
print('郭俞汝淨現值: ', f)
print('郭俞汝迴圈次數: ', loopNumber)
這學期學會網路程式語言JAVASCRIPT也學會人工智慧使用最多的PYTHON語言
嵌入網頁的指令<IFRAME SRC="網址"></IFRAME>
都齊全了!但截圖部分的excel下面太多空白,浪費。https://egdvcn-gh.blogspot.com/2025/06/blog-post.html
回覆刪除