페이지가 로드되지 않나요? 여기를 눌러보면 고쳐질 수도 있어요.
Placeholder

#9534

리스트1 - 연습문제 6 1초 - MB

문제

아래와 같은 리스트를 만들고, 그 리스트의 다양한 부분 리스트를 출력하는 프로그램을 작성하라. 

['Carrot', 'Onion', 'Cabbage', 'Potato', 'Sweet Potato', 'Bean'] 


예제1

출력
  : Carrot
: Bean
: ['Bean', 'Sweet Potato', 'Potato', 'Cabbage', 'Onion', 'Carrot']
li[2:5]: ['Cabbage', 'Potato', 'Sweet Potato']
li[5:2:-1]: ['Bean', 'Sweet Potato', 'Potato']
li[1:6:2]: ['Onion', 'Potato', 'Bean']

출처

자기주도 파이썬

역링크 공식 문제집만