1. Leaderboard without changing the scores
Write code Easy ✓ CompletedComplete the function leaderboard(scores). It must return a new list with the scores from highest to lowest, and it must not change the list it receives (the caller may still need the original order).
def leaderboard(scores):
# return a NEW list, highest score first
pass
results = [72, 95, 88, 61]
print(leaderboard(results))
print(results)
reverse=True for largest first.def leaderboard(scores):
return sorted(scores, reverse=True)
results = [72, 95, 88, 61]
print(leaderboard(results))
print(results)