How to fix ValueError: list.remove(x): x not in list in Python | DevErrors