>>> lst = ['a','b','c'] >>> i = lst.index('b') # This raises ValueError if there's no 'b' in the list. >>> lst[i:i+1] = 'b1','b2','b3' >>> lst ['a','b1','b3','c']
注意这只会改变第一个匹配的项目.