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

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

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

#문자열 슬라이싱 : 문자열[시작 인덱스:종료 인덱스]
#종료 인덱스는 항상 가져올 인덱스보다 1 크다
text3 = '파이썬은 재미있어요!'
print(text3[0:6])
print(text3[:7]) #처음부터
print(text3[3:]) #끝까지

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

Embed on website

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