"Python 딕셔너리"의 두 판 사이의 차이

 
(사용자 2명의 중간 판 7개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;Python Dictionaries
;Python Dictionaries
;Python dictionary, dict
;Python dictionary, dict
;파이썬 딕셔너리
;파이썬 딕셔너리 ( key & value )
* 예: {'a':1, 'b':2}
* 예: {'a':1, 'b':2}
* 파이썬 3.7 버전부터는 순서가 있다.
: 3.6까지는 순서가 없었다. (key의 순서가 바뀌는 등 보장이 없었다.)
 
<syntaxhighlight lang='python' run>
foo = {'a':1, 'b':2}
print(foo)
</syntaxhighlight>
<syntaxhighlight lang='python' run>
foo = {'a':1, 'b':2}
foo['c'] = 3
print(foo)
</syntaxhighlight>
<syntaxhighlight lang='python' run>
mydict1 = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
print(mydict1)
</syntaxhighlight>


==같이 보기==
==같이 보기==
{{z컬럼3|
* [[딕셔너리]]
* [[딕셔너리]]
* [[Python 리스트]]
* [[Python 리스트]]
* [[Python 딕셔너리 리스트]]
* [[Python 딕셔너리인지 확인]]
* [[파이썬 딕셔너리 for루프 키-값]] ★
* [[Python JSON 다루기]]
* [[Python JSON 다루기]]
* [[Python-JSON 자료형 대응]]
* [[Python-JSON 자료형 대응]]
* [[Python 튜플, 리스트, 딕셔너리]]
* [[Python 튜플, 리스트, 딕셔너리]]
}}


==참고==
==참고==

2021년 10월 27일 (수) 20:21 기준 최신판

1 개요[ | ]

Python Dictionaries
Python dictionary, dict
파이썬 딕셔너리 ( key & value )
  • 예: {'a':1, 'b':2}
  • 파이썬 3.7 버전부터는 순서가 있다.
3.6까지는 순서가 없었다. (key의 순서가 바뀌는 등 보장이 없었다.)
foo = {'a':1, 'b':2}
print(foo)
foo = {'a':1, 'b':2}
foo['c'] = 3
print(foo)
mydict1 = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
print(mydict1)

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}