《笨方法學 Python 3》39.字典,可愛的字典

get新技能: 1.  items()  :以列表返回可遍歷的(鍵, 值) 元組數組(字典),例如:↓↓↓ dick = {'name':'CX','sex':'Man','age':'26'} print(dick.items()) '''實際輸出結果 >>>[('name':'CX'),('sex':'Man'),('age':'26')] 2. get()  :返回指定鍵的值,如果值不在字
相關文章
相關標籤/搜索