Computer Science, asked by vanshika21052006, 7 months ago

18.
Write a program to find the second largest number of a list of numbers.​

Answers

Answered by milindingle1968
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 mansigamare304
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