69.6k views
5 votes
Write a function called highest_values that accepts as arguments a list of numeric values and a single integer (n)?

1 Answer

4 votes

Final answer:

The function highest_values accepts a list of numeric values and an integer n, and returns the n highest values from the list in descending order.

Step-by-step explanation:

The Function: highest_values

The function highest_values takes a list of numeric values and an integer n as arguments. It returns the n highest values from the list in descending order.

Example:

If we have a list [4, 1, 8, 3, 6] and n = 3, the function would return [8, 6, 4].

User Caillou
by
7.9k points