강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

sypark님의 프로필 이미지
sypark

작성한 질문수

프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)

딕셔너리(5-2)

dictionary 선언 관련 질문입니다

작성

·

77

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().

sypark님의 프로필 이미지
sypark

작성한 질문수

질문하기