파이썬딕션너리1 파이썬 기본 문법(딕셔너리,시퀀스의 특징) Dictionary[key] 딕션너리 자료 꺼내기person={'name':'Michael','age':10,'hometown':'Seoul'}print(person['name']) #Michaelprint(person['age']) #10person['hometown']=Seoul #person->Dictionary /hometown->key /Seoul->valuedel(delete)함수로 dictionary의 원소 삭제del person['age']print(person) #{name:Michael,'hometown': 'Seoul'}★key는 변할 수 없는 자료형->리스트는 안되고 튜플은 된다datas={[1,2,3]:'Alpabet'} (X)datas={(1,2,3):'number'} ok1.숫.. 2024. 8. 21. 이전 1 다음 728x90