How do you compare the objects in two lists, and then if there are two of the same objects in both lists, replace it with something? For example:
list1 = [a,b,c,d]
list2 = ['h','j','a','d']
I want to say, if some of the objects in list1
are the same with some of the objects in list2
, replace those objects with something else (For example, 'hello'
)