previous = candidates[name]
for i in range(len(criteria)):
    if possible[i] == 1:
        answer += criteria[i] + ' '
return answer
candidates = {'Ben': (72, 205, 4.0), 'Sam': (65, 220, 3.8), 'Hal': (74, 210,
    3.6)}
print(order_criteria(criteria, candidates, ('Ben', 'Sam', 'Hal')))
print(order_criteria(criteria, candidates, ('Sam', 'Hal', 'Ben')))
print(order_criteria(criteria, candidates, ('Hal', 'Ben', 'Sam')))
candidates2 = {'Ben': (72, 100, 1.0), 'Sam': (72, 90, 2.0), 'Hal': (64, 200,
    4.0)}
print(order_criteria(criteria, candidates2, ('Ben', 'Sam', 'Hal')))
print(order_criteria(criteria, candidates2, ('Sam', 'Hal', 'Ben')))
print(order_criteria(criteria, candidates2, ('Hal', 'Ben', 'Sam')))
Как определить критерии алгоритма ранжирования