강의

멘토링

로드맵

Inflearn Community Q&A

gumraze's profile image
gumraze

asked

Getting Started with Programming: Introduction to Python (Inflearn Original)

Dictionary (5-1): Dictionaries are useful and are often used.

0번째 출력

Written on

·

189

1

c 가 이렇게 선언 되어있어서, 0번째를 출력하고자 해서

출력하면, KeyError: 0 이라고 뜨네요

그리고 만약 c의 'arr'에서 어떠한 원소를 출력하고자 하면 어떻게 작성해야하나요?

python

Answer 1

2

niceman님의 프로필 이미지
niceman
Instructor

안녕하세요.

아래와 같이 key로 우선 접근 후 리스트 원소로 접근 가능합니다. 

c['arr'][0]

gumraze's profile image
gumraze

asked

Ask a question