Python: Third largest number from a list of numbers using set
Write a Python program to find the third largest number from a given list of numbers.Use the Python set data type.
Sample Solution:
Python Code:
Sample Output:
Original list of numbers: [1, 2, 3, 4, 5, 6, 7, 8, 9] Third largest number of the said list of numbers: 7 Original list of numbers: [1, 2, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10] Third largest number of the said list of numbers: 8 Original list of numbers: [1, 2, 3] Third largest number of the said list of numbers: 1 Original list of numbers: [1, 2, 2] Third largest number of the said list of numbers: None Original list of numbers: [1, 2] Third largest number of the said list of numbers: None
Flowchart:
Python Code Editor:
Previous: Combine three numbers to get the target number.
Next: Return unique strings from a list of strings.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics