Loading...
Loading...
Loading...
Print the second largest distinct value in a list. If the list has fewer than two different values, print none. The starter holds a program with a bug. Find it and fix it.
none.Example
Input
5 7 7 4 9 9
Output
7
The distinct values are 4, 7 and 9. The second largest is 7.
Try the problem first. Open one hint at a time.
Remove duplicates first, then look at the order of what is left.
Check how many distinct values there are before you pick the second.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor