18.
Write a program to find the second largest number of a list of numbers.
Answers
Answered by
1
Answer:
Python Program to Find the Second Largest Number in a List
Take in the number of elements and store it in a variable.
Take in the elements of the list one by one.
Sort the list in ascending order.
Print the second last element of the list.
Exit.
Answered by
0
Program Explanation
1. User must enter the number of elements and store it in a variable.
2. User must then enter the elements of the list one by one using a for loop and store it in a list.
3. The list should then be sorted.
4. Then the last element of the list is printed which is also the largest element of the list.
Similar questions
Math,
3 months ago
History,
3 months ago
Social Sciences,
7 months ago
Math,
7 months ago
English,
11 months ago