 winners = sorted(cnds, key=lambda k: int(k['votes']), reverse=True)[0:num_win] for cnd in cnds:     for winner in winners:         if cnd['cnd'] == winner['cnd']:             cnd['winner'] = True  This 