 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python program to find largest number in a list
In this article, we will learn about the solution and approach to solve the given problem statement.
Problem statement
Given list input, we need to find the largest numbers in the given list .
Here we will discuss two approaches
- Using sorting techniques
- Using built-in max() function
Approach 1 − Using built-in sort() function
Example
list1 = [18, 65, 78, 89, 90] list1.sort() # main print("Largest element is:", list1[-1]) Output
Largest element is: 90
Approach 2 − Using built-in max() function
Example
list1 = [18, 65, 78, 89, 90] # main print("Largest element is:",max(list1)) Output
Largest element is: 90
Conclusion
In this article, we learnt about the approach to find largest number in a list.
Advertisements
 