贴现值--作业
使用贴现率8%和12%分别计算每个项目的净现值(NPV).(Python)
贴现因子:为0.08时
n = 0.08 m = 1 i = 0 print("===============贴现率:",n,"====================") print("===============项目1 贴现值==================") a1 = -100000 a2 = [10000,10000,10000,20000,100000] while i<5: s = m/(m+n)**(i+1) # print(s) s2 = a2[i]*s #n2 = 30000*m #print(n2) a1 = a1 + s2 # print(a1) i = i+1 print(a1) i = 0 print("===============项目2 贴现值==================") b1 = -1000000 b2 = [200000,200000,200000,200000,300000] while i<5: s = m/(m+n)**(i+1) # print(s) s2 = b2[i]*s # n2 = 30000*m # print(n2) b1 = b1 + s2 i = i+1 i = 0 print(b1) print("=================项目3 贴现值===============") c1 = -100000 c2 = [30000,30000,30000,30000,300000] while i<5: s = m/(m+n)**(i+1) # print(s) s2 = c2[i]*s # n2 = 30000*m # print(n2) c1 = c1 + s2 i = i+1 i = 0 print(c1) print("================项目4 贴现值================") d1 = -120000 d2 = [30000,30000,30000,30000,75000] while i<5: s = m/(m+n)**(i+1) # print(s) s2 = d2[i]*s #n2 = 30000*m #print(n2) d1 = d1 + s2 i = i+1 print(d1) print("===================================")
贴现因子:为0.12时
n = 0.12 m = 1 i = 0 print("===============贴现率:",n,"====================") print("===============项目1 贴现值==================") a1 = -100000 a2 = [10000,10000,10000,20000,100000] while i<5: s = m/(m+n)**(i+1) print("贴现因子:",'%.4f' % s) s2 = a2[i]*s a1 = a1 + s2 i = i+1 print(a1) i = 0 print("===============项目2 贴现值==================") b1 = -1000000 b2 = [200000,200000,200000,200000,300000] while i<5: s = m/(m+n)**(i+1) print("贴现因子:",'%.4f' % s) s2 = b2[i]*s #n2 = 30000*m #print(n2) b1 = b1 + s2 i = i+1 i = 0 print(b1) print("=================项目3 贴现值===============") c1 = -100000 c2 = [30000,30000,30000,30000,300000] while i<5: s = m/(m+n)**(i+1) print("贴现因子:",'%.4f' % s) s2 = c2[i]*s #n2 = 30000*m #print(n2) c1 = c1 + s2 i = i+1 i = 0 print(c1) print("================项目4 贴现值================") d1 = -120000 d2 = [30000,30000,30000,30000,75000] while i<5: s = m/(m+n)**(i+1) print("贴现因子:",'%.4f' % s) s2 = d2[i]*s #n2 = 30000*m #print(n2) d1 = d1 + s2 i = i+1 print(d1) print("===================================")
内部回报率:
n = 0.158926 m = 1 i = 0 print("===============贴现率:",n,"====================") # print("===============项目1 贴现值==================") # a1 = -100000 # a2 = [10000,10000,10000,20000,100000] # while i<5: # s = m/(m+n)**(i+1) # print("贴现因子:",'%.4f' % s) # s2 = a2[i]*s # a1 = a1 + s2 # i = i+1 # print(a1) # ===============贴现率: 0.101659591 ==================== # ===============项目1 贴现值================== # 贴现因子: 0.9077 # 贴现因子: 0.8240 # 贴现因子: 0.7479 # 贴现因子: 0.6789 # 贴现因子: 0.6163 # 贴现回报率 # 0.028480038767156657 # =================================== # ***Repl Closed*** i = 0 # print("===============项目2 贴现值==================") # b1 = -1000000 # b2 = [200000,200000,200000,200000,300000] # while i<5: # s = m/(m+n)**(i+1) # print("贴现因子:",'%.4f' % s) # s2 = b2[i]*s # #n2 = 30000*m # #print(n2) # b1 = b1 + s2 # i = i+1 # i = 0 # print(b1) # ===============贴现率: 0.0307271 ==================== # ===============项目2 贴现值================== # 贴现因子: 0.9702 # 贴现因子: 0.9413 # 贴现因子: 0.9132 # 贴现因子: 0.8860 # 贴现因子: 0.8596 # 贴现回报率 # 0.04825905873440206 # =================================== print("=================项目3 贴现值===============") c1 = -100000 c2 = [30000,30000,30000,30000,30000] while i<5: s = m/(m+n)**(i+1) print("贴现因子:",'%.4f' % s) s2 = c2[i]*s #n2 = 30000*m #print(n2) c1 = c1 + s2 i = i+1 print(c1) i = 0 # ===============贴现率: 0.443213 ==================== # =================项目3 贴现值=============== # 贴现因子: 0.6929 # 贴现因子: 0.4801 # 贴现因子: 0.3327 # 贴现因子: 0.2305 # 贴现因子: 0.1597 # 贴现回报率 # 0.037686945288442075 # =================================== # print("================项目4 贴现值================") # d1 = -120000 # d2 = [30000,30000,30000,30000,75000] # while i<5: # s = m/(m+n)**(i+1) # print("贴现因子:",'%.4f' % s) # s2 = d2[i]*s # #n2 = 30000*m # #print(n2) # d1 = d1 + s2 # i = i+1 # print(d1) # ===============贴现率: 0.158926 ==================== # ================项目4 贴现值================ # 贴现因子: 0.8629 # 贴现因子: 0.7445 # 贴现因子: 0.6424 # 贴现因子: 0.5543 # 贴现因子: 0.4783 # 贴现回报率 # -0.04344610997941345 print("===================================")