데이터를 비순차적으로 저장하는 순열 자료구조
** 순열 : n개의 원소에서 r개를 골라 나열하는 방법
요소를 추가한 순서대로 저장되지 않는다.
수정 가능
동일한 값을 여러개 넣는것이 불가능하다. 중복된 값이 있으면 최근에 들어온 값으로 대체된다.
set 에서 요소들이 저장될 때 순서
# dictionary create 1
dictionary1 = {'name':['Ryan','Lee'], 'job':'sw engineer', 'address': {'city':'seoul', 'zip_code':'1234'} }
# dictionary create 2
dictionary2 = {}
dictionary2['name'] = ['Ryan', 'Lee']
dictionary2['job'] = 'sw engineer'
dictionary2['address'] = {'city':'seoul', 'zip_code':'1234'}
# dictionary create 3
dictionary3 = dict(name=['Ryan','Lee'], job='sw engineer', address={'city':'seoul','zip_code':'1234'})
# dictionary create 4
dictionary4 = dict([('name',['Ryan','Lee']), ('job','sw enginner'), ('address',{'city':'seoul','zip_code':'1234'})])
# # 튜플로 받아온 정보로 키와 값을 만든다.
네개 다 아래와 같은 결과가 나온다.
dictionary1 = {'name':['Ryan','Lee'], 'job':'sw engineer', 'address': {'city':'seoul', 'zip_code':'1234'} }