I have to search through a list and replace all occurrences of one element with another. So far my attempts in code are getting me nowhere, what is the best way to do this?<
for i in range(0, len(lst)): lst.insert(i, lst[i]) lst.remove(lst[i+1])