dictionary 선언 관련 질문입니다

20.09.27 16:47 작성 조회수 19

0

삭제된 글입니다

답변 1

답변을 작성해보세요.

0

문자열 입니다.

다만 파이썬 딕셔너리의 키 타입은 숫자도 지원하므로 편하신대로 사용하시면 됩니다.

Another useful data type built into Python is the dictionary (see Mapping Types — dict). Dictionaries are sometimes found in other languages as “associative memories” or “associative arrays”. Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by keys, which can be any immutable type; strings and numbers can always be keys. Tuples can be used as keys if they contain only strings, numbers, or tuples; if a tuple contains any mutable object either directly or indirectly, it cannot be used as a key. You can’t use lists as keys, since lists can be modified in place using index assignments, slice assignments, or methods like append() and extend().