[파이썬,Python] Dictionary 딕셔너리

Gayoung Lee·2022년 5월 17일
0

Python

목록 보기
3/3

dictionary ?

  • immutable 한 key와 mutable한 value의 맵핑으로 구성된 순서없는 집합
  • 키로 접근하는 자료구조

문법

  • dic = { 'a':1, 'b':2 }

dictionary for문

  • value 값으로 for문 => values() 사용
for val in a.values():
	print(val)
  • key와 value 동시에 반복 => items() 사용
for key,val in a.items()
profile
삽질하며 성장하는 gayoungee

0개의 댓글