#문자열 원소
print("안녕하세요")
text1 = '파이썬'
text2 = '이썬파'
print(text1 == text2)
#문자열은 순서를 가진다
#인덱스 : 0부터 시작한다!!
#문자열 인덱싱 : 문자열[인덱스]
text3 = '안녕하세요'
print(text3[3])
print(text3[1])
print(text3[-1])
print(text3[-3])
print('apple'[3])
#문자열 슬라이싱 : 문자열[시작 인덱스:종료 인덱스]
#종료 인덱스는 항상 가져올 인덱스보다 1 크다
text4 = '파이썬은 재미있어요!'
print(text4[0:7])
print(text4[:7]) #시작 인덱스 자리가 비어있으면 처음부터
print(text4[3:]) #종료 인덱스 자리가 비어있으면 끝까지
print(text4[-6:-4])
print('----문제----')
text5 = 'Hello! Python'
#Python 출력
print(text5[7:13])
#! 출력
print(text5[5])
#소문자 h 출력
print(text5[-3])
To embed this project on your website, copy the following code and paste it into your website's HTML: