Python字典學習

Python字典 建立新的字典python 直接賦值 >>> dict1 = {} # 給 dict1 賦初值爲空字典 >>> dict1 # 查看 dict1 無內容 {} 經過fromkeys賦值 # 經過 fromkeys 賦初值後,key 部分有內容,Value 部分爲 none >>> dict1.fromkeys((1,2,3)) {1: None, 2: None, 3: None
相關文章
相關標籤/搜索