[300제] 53번

LILO Ghim·2021년 10월 25일
post-thumbnail

List 메서드 : insert

insert(index, "요소")
특정 위치에 값을 끼어넣기 할 수 있는 메서드

|예시

wine_list = ['champagne', 'white', 'red', 'port', 'natural']

wine_list.insert(1, 'sparkling')

print(wine_list)
['champagne', 'sparkling', 'white', 'red', 'port', 'natural']
profile
킴릴로

0개의 댓글