DICTIONARY
-
#3 파이썬 dictionary 딕셔너리 이용컴퓨터/파이썬 2020. 6. 20. 14:18
기본 문법 키, 값, print, update(), test_dic = {'a': {'b': 'c'}, 'd': 'e'} print(test_dic['a']['b']) # 출력 : 'c' test_dic['a'].update({'o': {'f': 'e'}}) print(test_dic) # {'a': {'b': 'c', 'o': {'f': 'e'}}, 'd': 'e'} keys(), values(), in, items() test_dic = {'a': {'b': 'c'}, 'd': 'e'} print(test_dic.keys()) # dict_keys(['a', 'd']) 최상위 key들만 표시됨 print(test_dic.values()) # dict_values([{'b': 'c', 'o': {'f'..