Lists and collections · Python exercise
Find the second largest distinct integer in a list.
Read one line of space-separated integers and print the second largest distinct value. If no such value exists, print No second largest.
Example 1
Input
3 9 2 9
Output
3
The distinct values are 9, 3, and 2.
Example 2
Input
1 1 1
Output
No second largest
How testing works
Your code runs once per test case with that case's standard input. Output is compared after normalising trailing spaces and blank lines at the end. Use input() without a prompt when the exercise expects clean output.
Loading editor…
Press Run tests to execute your code against every input case. Python runs in a Web Worker in your browser.