博文

目前显示的是 三月, 2023的博文

王怡庭python:集合set串列或清單list字典dictionary元組tuple

图片
w3schools截圖 w3schools程式碼 #王怡庭 集合{},字典{key:value,},元組(),清單] s= {"台積電", "鴻海", "聯發科"} t= ("台積電", "鴻海", "聯發科") list= ["台積電", "鴻海", "聯發科"] d= {2330:"台積電",2317:"鴻海",2454:"聯發科"} print("型態" + str(type(s)) + str(s)) print("型態" + str(type(t)) + str(t)) print("型態" + str(type(d)) + str(d)) print("型態" + str(type(list)) + str(list)) #字串與字串才能+所以要用str轉成字串 i = 0 for a in list: i = i+1 print("台灣第" + str(i) + "大的公司是") print(" " + a) w3schools集合方法 Python has a set of built-in methods that you can use on sets. Method Description add() Adds an element to the set clear() Removes all the elements from the set copy() Returns a copy of the set difference() Returns a set containing the difference between two or more sets difference_update() Removes the items in this set that are also included in another, ...

王怡庭python字典

图片
w3schools截圖 程式碼 #王怡庭 字典 key:value a = { 2330: "台積電", 2317: "鴻海", 2454: "聯發科", 2412: "中華電", 6505: "台塑化", 2308: "台達電",} print(a) print("用迴圈印出所有值") for t in a: print(a[t] +" 用get()方法 " + a.get(t)) a.update({1108:"幸福"}) print(a) a.popitem() print(a) a.update({6505:"台塑化"}) a.update({2308:"台達電"}) print(a.keys()) print("練習values方法") print(a.values()) print("練習items方法") print(a.items()) w3schools字典方法 Python has a set of built-in methods that you can use on dictionaries. Method Description clear() Removes all the elements from the dictionary copy() Returns a copy of the dictionary fromkeys() Returns a dictionary with the specified keys and value get() Returns the value of the specified key items() Returns a list containing a tuple for each key value pair keys() Returns a list containing the dictionary's keys pop() Removes the element wi...

王怡庭ppt動畫轉成mp4影片

ppt動畫轉成mp4影片

王怡庭SVG與CAWVAS

w3schools練習SVG SVG Sorry, your browser does not support inline SVG.

王怡庭powerpoint動畫:animation,格式format

图片