#문자열 원소
text1 = '안녕하세요'
print(text1)

text2 = '파이썬'
text3 = '썬파이'
print(text2 == text3)

#인덱스 : 0부터 시작한다!!
#문자열 인덱싱 : 문자열[인덱스]
print(text1[3])
print(text1[-5])
print('Ready'[2])

#문자열 슬라이싱 : 문자열[시작 인덱스:끝 인덱스]
#종료 인덱스는 항상 가져올 인덱스보다 1 크다
text4 = '안녕하세요.나는 박주현입니다'
print(text4[9:12])
print(text4[2:5]) #하세요
print(text4[:3]) #처음부터
print(text4[7:]) #끝까지

print('-----숙제-----')
text5 = 'Hello! Python'
#Python 출력
print(text5[7:])
#!출력
print(text5[5])
#소문자 h출력
print(text5[-3])

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: