인프런 커뮤니티 질문&답변
답변 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().





