첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
구분 코드
#1
a = "Life is too short, You need Python"

print(a[3])

"""
e
"""
#2
a = "Life is too short, You need Python"

print(a[-1])

"""
n
"""
#3
※ [시작번호 : 종료번호] → 시작번호 <= 인덱스 < 종료번호

a = "Life is too short, You need Python"

print(a[0:4])

"""
Life
"""
#4
a = "Life is too short, You need Python"

print(a[:17])

"""
Life is too short
"""
#5
a = "Life is too short, You need Python"

print(a[:])

"""
Life is too short, You need Python
"""
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요