a = [10, 20, 40, 50]

#append() 맨 뒤에 삽입
a.append(60)
print(a)

#insert() 내가 원하는 위치에 삽입
a.insert(2, 30)
print(a)

#remove() 삭제
a.remove(10)
print(a)

#sort() 정렬
b = [4, 6, 7, 3, 2, 5, 1]
c = ['banana', 'apple', 'cola']
b.sort()
c.sort()
print(b, c)

#인덱스, 인덱싱, 슬라이싱
str = "coffee"
print(str[1], str[2:4])

#길이
print(len(b))
print(len(str))

#시퀀스 더하기
print([10, 20] + [30, 40])
print("ab" + "cd")

#시퀀스 곱하기
print([10, 20] * 3)
print("ab" * 2)


Embed on website

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