1. List i번째 인자 제거

test = [5, 6, 7, 8]
del test[1]

print(test)
# [5, 7, 8]

 

 

 

2. List i번째 위치에 x 라는 데이터 삽입

test = [5, 6, 7, 8]
test.insert(1, 9)

print(test)
# [5, 9, 6, 7, 8]

 

 

 

3. List x 라는 데이터 삭제

test = [5, 6, 7, 8]
test.remove(7)

print(test)
# [5, 6, 8]

 

 

+ Recent posts