6 lines
96 B
Python
6 lines
96 B
Python
def replace(l, X, Y):
|
|
while X in l:
|
|
i = l.index(X)
|
|
l.pop(i)
|
|
l.insert(i, Y)
|