Approach : Sort and find unique second python scores = sorted(set(scores), reverse=True) print(scores[1]) # Second element set() removes duplicates. sorted(..., reverse=True) orders highest to lowest.
Index is the second highest. Approach : Track two values python first = second = float('-inf') for score in scores: if score > first: second = first first = score elif score > second and score != first: second = score This one-pass approach is more efficient but more complex.
For this problem, the sorting approach is simpler.