Candidate elimination in Python