I keep getting this error when running my code:
ValueError: list.remove(x): x not in list
With this code I’m supposed to check the elements in lst and in listOfOperatorsDomains. If they are the same (I used [if x in y] and not [if x == y] because of the context), then I append those two values to another list (listOfRequestsAssigned) and remove the element y from lst. However, the line where I remove the element y is giving me that error.
for y in lst: for k in listOfOperatorsDomains: if y in k: element = listOfOperatorsDomains.index(k) listOfRequestsAssigned.append([y,operators[element],"assigned"]) lst.remove(y) return listOfRequestsAssigned