發表文章

李珮瑄Python_Javascript網路執行_EXCEL_IRR二分法

圖片
pmt = [0,0,0,0] #李珮瑄程式設計586設定串列list pmt[0]=float(input('躉繳金額: '))#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 maxerror and gap > maxerror): if ( f>0 ): a = c else: b = c gap = b-a; print('李珮瑄報酬率: ', c) print('李珮瑄淨現值: ', f) print('李珮瑄迴圈次數: ', loopNumber) 心得 這學期學會網路程式語言JAVASCRIPT也學會人工智慧使用最多的PYTHON語言 嵌入網頁的指令

李珮瑄二分法求內部報酬率

圖片
head/head, body/body畫蛇添足,可拿掉,因為部落格架構已經下這些命令。資訊科學系的必修課「數值方法」或是應用數學系的必修課「數值分析」。 躉繳 第1期 第2期 第3期 注意,包含首期躉繳的現金流量都大於0。 輸出: 報酬率: 淨現值: 迴圈次數: 李珮瑄學習程式設計程式碼如下 <IFRAME WIDTH='100%'SRC='https://zh.wikipedia.org/zh-tw/%E4%BA%8C%E5%88%86%E6%B3%95_(%E6%95%B8%E5%AD%B8)'></IFRAME> head/head, body/body畫蛇添足,可拿掉,因為部落格架構已經下這些命令 <style> h1 {margin: 0;padding:20px 0;color:black;  text-shadow: 4px 4px 2px pink;} .Takming {border: 20px outset red;background-color: green;   color: white; text-align: center;} .pmt {width: 60pt;height: 20pt;background-color: coral;   color: white; text-align: right;} </style> <table border="1"> <tr align="center"><td>躉繳</td><td>第1期</td><td>第2期</td><td>第3期</td></tr> <tr><td><input class="pmt" type="number" /></td>    <td><input class="pmt" type="number" />...

金融計算與WORD方程式編輯器

圖片
利率y(rate) 期數n(nper) 金流m(pmt) 終值f(fv) 參考劉任昌金融市場講義https://drive.google.com/file/d/17z6UZgN5fC2XCO1L8_BQs57dgQXzbwou/view?usp=sharing 李珮瑄學習HTML+CSS+JavaScript程式碼 body指令拿掉,因為沒有作用。部落格已經設定body 使用到的PYTHON指令 在Spyder開發環境編寫與執行Python 第一個python沒有使用函數def '''PYTHON註解三個單引號或雙引號前後''' r=float(input('利率: '))#input輸入是字串string n=float(input('期數: '))#要計算轉為實數real nubers m=float(input('收付: '))#浮點點float f=float(input('終值: ')) pv = f/(1+r)**n pv += m/r*(1 - 1/(1+r)**n) print('李珮瑄計算現值', pv) 迴圈對照EXCEL填滿 '''PYTHON註解三個單引號或雙引號前後''' def pv(r,n,m,f):#自訂函數 p = m/r*(1 - 1/(1+r)**n)+f/(1+r)**n return p#執行函數的結果傳回去 n=float(input('期數: '))#要計算轉為實數real nubers m=float(input('收付: '))#浮點點float f=float(input('終值: ')) for i in range(1,10):#迴圈 r = i*0.01 x=pv(r,n,m,f) print('利率 ', r ,'價格 ', x)

李珮瑄三個Javascript函數sin,cos與canvas.font

Javascript在網頁就可以執行不需要開啟Spyder sin執行 cos執行 橫軸

李珮瑄Javascript執行三角函數繪圖

圖片
Javascript在網頁就可以執行不需要開啟Spyder 李珮瑄執行

李珮瑄繪製python三角函數

圖片
python程式碼 from tkinter import * #或者import tkinter as tk import math #第9列(z1=10), 13列(廣域變數),插入16列cos,插入18繪圖 tk = Tk() #建構視窗名為tk tk.geometry('1200x400') tk.title("李珮瑄python tkinter三角函數") canvas = Canvas(tk, width=1200, height=400, bg='black') canvas.grid(row=0,column=0,padx=5,pady=5,columnspan=3) delay=2 # milliseconds, 1/1000秒 x1,y1,z1=0,200,10 #Python特徵: 多變數=多個值 h=190 #上下範圍 degree=0 #角度degree def LauHou(): l0=canvas.create_line(0,200,1200,200,fill='white',width=3) global x1, y1, z1 x2 = x1 + 1 y2=200 - h*math.sin(0.02*x2)#座標從左上角0.... z2=200 - h*math.cos(0.02*x2) l1=canvas.create_line(x1,y1,x2,y2,fill='red',width=5) l2=canvas.create_line(x1,z1,x2,z2,fill='yellow',width=5) if (x2

World File Processing in Python( Python處理Word檔)

圖片
embed嵌入(bed床,放入床上,嵌入鑽戒) 影片重點 Let's develop brains. 作文,在捷運讓座let給老弱婦孺。 yield (投降, 收益) Yield seats to elderly YTM=Yield to Maturity=到期收益率 nominal yield=coupon rate=票面利率 利用python編輯edit建立create word 檔案 Process 處理....procedure程序 SOP  維基百科python了解 python命令,給文件新增加一個段落 document.add_paragraph('文字內容',格式) 網頁javascript命令 document.create_element('P'); 維基百科python了解 Python was conceived in the late 1980s[42] by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands; it was conceived as a successor to the ABC programming language, which was inspired by SETL,[43] capable of exception handling and interfacing with the Amoeba operating system.[12] Python implementation began in December 1989.[44] Van Rossum assumed sole responsibility for the project, as the lead developer, until 12 July 2018, when he announced his "permanent vacation" from responsibilities as Python's "benevolent dictator for life" (BDFL); this title was bestowed on...