![](https://blog.kakaocdn.net/dn/Zc25V/btrqAVSX7mB/UUY0oYnhEn27GTOJtisQNk/img.png)
코드
![](https://blog.kakaocdn.net/dn/wVJ91/btrqAnoDZgx/xN5rLqwokE2i5hz7UsPkvK/img.png)
실행화면
names[1:3] -> 인덱스 3 전까지 출력
names[2:-1] -> 인데스 –1 전까지 출력
헷갈림 주의
'PYTHON' 카테고리의 다른 글
[17] Python - List Methods (0) | 2022.01.12 |
---|---|
[16] Python - 2D Lists (0) | 2022.01.12 |
[14] Python - Nested Loops (0) | 2022.01.12 |
[13] Python - For Loops (0) | 2022.01.12 |
[12] Python - Car game (0) | 2022.01.12 |