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

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

#문자열 인덱싱
print(text[0])

print(text[0:3])
print(text[:2])
print(text[2:])


#예제1 
#문자열 "파이썬은 재미있어요!"에서 "재미"라는 단어만 출력
text3 = '파이썬은 재미있어요!'
print(text3[4:6])

#예제2
#bag에 들어 있는 요소 중 '금' 3개를 jewel에 저장하는 코드
bag = ['은', '은', '은', '금', '금', '금', '은', '은']
jewel = bag[????]
print(jewel)

Embed on website

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