發表文章

黎冠妤整合開發環境的jubyter編輯python程式碼

圖片
SPYDER程式碼 程式碼 from tkinter import * #從函式庫 tkinter 輸入所有 * 方法 banks=['摩根大通','美國銀行','中國工商','富國銀行','匯豐銀行','巴黎銀行'] def ABC(): #畫圖 define自訂函數 global b1 txt = '' for i in range(len(banks)): txt += banks[i] + ' ' b1=Label(canvas,text=txt,font='Arial 20 bold') b1.pack(side=TOP) def XYZ(): #清除視窗的all所有canvas圖 banks.append('三菱銀行') banks.append('000銀行') ABC()#結束XYZ之前給它顯示 def kill(): b1.pack_forget() tk = Tk() tk.title("黎冠妤python建立tkinter視窗使用者介面") #也可以定義視窗名為 window, root課本都如此習慣 canvas = Canvas(tk, width=400, height=400) canvas.pack() btn1 = Button(tk, text="顯示銀行", command = ABC, bg='black',fg='white').pack(side=LEFT) btn2 = Button(tk, text="000增加", command = XYZ).pack(side=LEFT) btn3 = Button(tk, text="000刪除", command = kill).pack(side=LEFT) tk.mainloop()

黎冠妤Javascript與Python比較

全球市場價值最大的銀行 按鈕push增加 pop刪除最後一項 按鈕pop執行kill呼叫其他函數 CSS也可以in-line 以上javascript與html與css程式碼

黎冠妤python串列List(陣列Array),元組Tuple,集合Set,字典Dict

圖片
EMBED嵌入影片522 期中考試重點 .SELECTOR{用在多個元素} UL=UNDERER LIST, OL=ORDERED LIST, LI=LIST 大括號{ } CURLY BRACKET, CURLY捲,用於PYTHON的集合 中括號[ ] SQUARE BRACKET, SQUARE方形,用於PYTHON串列 小括號( )CIRCLE BRACKER, CIRCLE圓,用於 PYTHON元組 角括號<>CORNER BRACKET 圓周CIRCUMFERENCE,直徑DIAMETER, 半徑RADIUS BORDER邊界, SOLID實心, PX=PIXEL點,

2025年3月4日上課Python陣列array串列的函數(方法)

利用w3schools練習的python指令 animal = ["豬", "牛", "羊", '貓'] #python語言的註解comments x = animal.copy() print(animal) x.reverse() #將x反轉reverse print(x) animal.append('狗') print(animal) y = animal.copy() y.reverse() #將x反轉reverse print(y)

乙班0225黎冠妤利用chatgpt大語言模型產出程式碼

圖片
黎冠妤Canvas 計算機 黎冠妤Canvas 計算機 Python陣列方法 Method Description append() Adds an element at the end of the list clear() Removes all the elements from the list copy() Returns a copy of the list count() Returns the number of elements with the specified value extend() Add the elements of a list (or any iterable), to the end of the current list index() Returns the index of the first element with the specified value insert() Adds an element at the specified position pop() Removes the element at the specified position remove() Removes the first item with the specified value reverse() Reverses the order of the list sort() Sorts the list Python陣列方法在撰寫模式貼上 a Method Description append() Adds an element at the end of the list clear() Removes all the elements from the list copy() Returns a copy of the list count() Returns the number of elements with the specified value extend() Add the elements of a list (or any iterable), to the end of the current list index() Returns the ind...

乙班黎冠妤期末考Math.PI與Math.E放入計算機

黎冠妤學習Bro code製作計算機 + 7 8 9 - 4 5 6 x 1 2 3 ÷ 0 . = C π e ** https://www.youtube.com/watch?v=I5kj-YsmWjM Build this JS calculator in 15 minutes!

已搬黎冠妤eval函數將數字串運算

黎冠妤學習Bro code製作計算機 display.value = eval(display.value) display的vlue用eval(display.value)取代,算是「字串」運算結果 eval()內建函數(方法) in-line線內設定樣式。readonly唯讀read only。電腦的.的接續術性或函數disply.value面板顯示的內容value值。px=pixel點 + 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!