推 tiefblau:老實說你打完這篇也就google完dict是啥了 他是py的一個資 05/12 21:27
→ tiefblau:料結構 你們老師要的應該是去掉重複的這個特性 因為就跟 05/12 21:27
→ tiefblau:一般用的字典一樣 一個key只會有一個值 重複的key會砍掉 05/12 21:28
→ tiefblau:但是用set不就好了嗎= =+ 05/12 21:29
→ harohepowegr:那東西寫進dictionary可以在上面那個函式接下去寫嗎? 05/12 21:35
推 funnypeter:可以阿,用pickle 05/12 21:51
→ funnypeter:pickle可以存python的資料結構 05/12 21:52
→ funnypeter:你可以寫一個pickle為主的class 05/12 21:52
→ funnypeter:讀寫操作寫在method 05/12 21:53
→ funnypeter:例如 class dic 05/12 21:54
→ funnypeter:a=dic('filename','r') 05/12 21:55
→ funnypeter:然後內部你用pickle打開 05/12 21:55
→ funnypeter:其他讀寫merhod內部都用pickle幫你完成 05/12 21:57
→ funnypeter:詳細自己去官網看說明,1小時就能完成 05/12 21:58
→ mantour:不知道是你沒聽懂老師的問題 還是老師的問題原本就沒說清 05/12 22:22
→ mantour:楚? dict是一個資料結構 而不是一種檔案格式 05/12 22:23
→ mantour:dictionary要怎麼寫進檔案裡的方法可以是任意的 05/12 22:28
→ mantour:pickle也不是serialization的唯一方式 05/12 22:28