Popular posts from this blog
python tkinter繪圖對比EXCEL
def pv(r,n,m,f):#劉任昌函數參數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) import tkinter as tk#輸入tkinter繪圖 root = tk.Tk() root.title('張禹希python tkinter') root.geometry('600x600')#寬度width改成600 canvas = tk.Canvas(root, width=600, height=300) # 加入 Canvas 畫布 canvas.pack() x, y = 0, 0 canvas.create_line(0, 400, 500, 400, width=5,fill='blue') canvas.create_line(5, 0, 5, 400, width=5,fill='blue') for x in range(1, 400): x1 = x+1 y1 = 400 - pv(x1,n,m,f)*400 canvas.create_line(x, y, x1, y1, width=5,fill='green') canvas.pack() x = x1 y = y1 root.mainloop()
張禹希學習Bro Code製作計算機
劉任昌學習Bro code製作計算機 + 7 8 9 - 4 5 6 × 1 2 3 ÷ 0 . = 刪 張 禹 希 https://www.youtube.com/watch?v=I5kj-YsmWjM Build this JS calculator in 15 minutes! 心得與考試重點 LIST條例,UL=UNORDERED LIST ,OL=ORDERED LIST,BUTTON按鈕,CLICK按下,ONCLICK事件 網頁的命令,大小寫都可以。 刪 <button onclick="clearDisplay()">刪 SCRIPT區段有三個自訂的函數 function appendToDisplay(input) { const display = document.getElementById("display"); display.value += input;} function clearDisplay() { const display = document.getElementById("display"); display.value = "";} function calculate() { const display = document.getElementById("display"); try{ display.value = eval(display.value); } catch(error){display.value = "Error";} }
Comments
Post a Comment