'''
시퀀스 자료형 특징
1. 원소에 순서가 있다
2. 특정 원소를 조회할 수 있다
3. 길이를 확인할 수 있다
4. 연결 연산을 할 수 있다
5. 반복 연산을 할 수 있다
'''
#3. 길이를 확인할 수 있다 - len(시퀀스)
print(len('! sidlvhfwsfhehjopibcsy져론대ㅑㄷ옂ㄱ휼ㄷㅇ노ㅑㅏㄷ뢔고'))
a = [1, 2, 3, 4, 5]
print(len(a))

#4. 연결 연산을 할 수 있다 +
print('안녕'+'하세요')
b = ['t','w','i'] + ['c','e']
print(b)

#5. 반복 연산을 할 수 있다 *
print('hi' * 3)
c = ['bye'] * 5
print(c)

print('----반복문 for----')
#기본형: for 변수 in 시퀀스:
#            <반복할 명령>
#시퀀스의 길이만큼 반복된다

for i in [1, 2, 3]:
    print(i)

for a in 'abcde':
    print('!')

print('-----문제----')
menu = ['김밥', '라면', '떡볶이', '돈가스']

for item in menu:
    print(item)

Embed on website

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