728x90
Dictionary
-
[Python tutorial] 10. Data type - Dictionary코딩/Python 2022. 12. 21. 17:14
Dictionaries key:value pairs ordered changeable do not allow duplicates thisdict = { "brand": "Ford", "model": "Mustang", "year": 1964 # any data types } print(thisdict) print(thisdict["brand"]) {'brand': 'Ford', 'model': 'Mustang', 'year': 1964} Ford Access Dictionary Items x = thisdict["model"] print(x) # Mustang # get() x = thisdict.get("model") print(x) # Mustang # Get Keys: keys() x = thisd..