| 구분 | 설명 |
|---|---|
| 자료구조(Data Structure) | 데이터를 구성·저장·관리하는 구조 |
| 파이썬의 주요 자료구조 | 문자열(str), 리스트(list), 튜플(tuple), 딕셔너리(dict), 집합(set) |
| 용도 | 데이터를 효율적으로 저장, 검색, 수정, 관리하기 위함 |
' ' 또는 큰따옴표 " " 사용''' ''' 또는 """ """a = '''Hello
Python'''
word = 'Python'
print(word[0]) # 'P'
print(word[-1]) # 'n'
문자열변수[index]word = 'Python'
print(word[0:2]) # 'Py'
print(word[2:]) # 'thon'
print(word[-2:]) # 'on'
📘 형식: 문자열[start:stop:step]
stop 인덱스는 포함되지 않음step 기본값은 1