파이썬(python) - 딕셔너리(dictionary) 문법 활용 (1)
리스트 2개를 딕셔너리로 변환 >>> pro = ['a', 'b', 'c'] >>> sp = [1, 2, 3] >>> >>> dic = { pro[i] : sp[i] for i in range(len(pro))} >>> >>> dic {'a': 1, 'b': 30, 'c': 5} 딕셔너리에 리스트 추가하기 다음 방법은 여러가지 기준으로 분류 할때 사용됩니다. >>> dic = {} >>> dic['fruit'] = ['apple'] >>> dic['fruit'].append('banana') >>> dic {'fruit': ['apple', 'banana']} 다음과 같이 put 리스트가 주어질 때 put = [['fruit','apple'],['fruit','bananan'],['fruit','melo..