Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Quiz: Top Three
- Write a function, top_three, that takes a list as its argument, and returns a list of the three largest elements. For example, top_three([2,3,5,6,8,4,2,1]) == [8, 6, 5]
- def top_three(input_list):
- input_list = sorted(input_list, reverse=True)
- return input_list[:3]
- Your code displayed no output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement