#리스트 메서드
#1. 추가하기 append()
list1 = [1, 2, 3]
list1.append(4) #리스트 맨 뒤에 추가하기
print(list1)
#2. 추가하기 insert()
list2 = ['가','다','라']
list2.insert(1,'나') #특정 위치에 추가하기
print(list2)
#3. 삭제하기 remove()
list2.remove('다')
print(list2)
#4. 정렬하기 sort()
list3 = [4, 6, 3, 10, 2]
list4 = ['a','c','f','e','b','d']
list3.sort()
list4.sort()
print(list3)
print(list4)
#시퀀스 조회하기
s1 = 'icecream'
print('c' in s1)
print('k' in s1)
#시퀀스 길이 확인하기
print(len(s1))
#시퀀스끼리 연결 연산 가능
s2 = ['a', 'b', 'c'] + [1, 2] #시퀀스 더하기
s3 = '123' * 3 #시퀀스 곱하기
print(s2)
print(s3)
To embed this project on your website, copy the following code and paste it into your website's HTML: