:
(max_score, max_player) = max( (max(a, b), player) for (player, a, b) in players )
(min_score, min_player) = min( (min(a, b), player) for (player, a, b) in players )
If instead you want the players with the highest and lowest final score, just replace max(a, b)and min(a, b)on a + b.
Please note that this selects one best / worst player, even if there is a tie.
Find the average values of the first and second points:
avg_round1 = float(sum( a for (_, a, _) in players )) / len(players)
avg_round2 = float(sum( b for (_, _, b) in players )) / len(players)
source
share