filmov
tv
Joy of python programming | Assignment 3 | program 1- Find 2nd largest number in a list | O(n) Time

Показать описание
Create a Python program that finds the second largest number in a list of positive integers(includes zero). The program should prompt the user to input a list of numbers, then compute and print the second largest number in that list.
Input Format:
The input consists of a single list of numbers, separated by spaces.
Hint: Use .split() function to convert input to list.
Output Format:
The output consists of the second largest number in the input list.
Example:
Input:
3 1 4 1 5 9 2 6 5 3 5
Output:
6
Input Format:
The input consists of a single list of numbers, separated by spaces.
Hint: Use .split() function to convert input to list.
Output Format:
The output consists of the second largest number in the input list.
Example:
Input:
3 1 4 1 5 9 2 6 5 3 5
Output:
6