- Related Questions & Answers
- Python program to find largest number in a list
- Python program to find the second largest number in a list
- Python program to find N largest elements from a list
- Python program to find Largest, Smallest, Second Largest, and Second Smallest in a List?
- Python program to find the smallest number in a list
- Program to find the largest grouping of anagrams from a word list in Python
- Python Program for Find largest prime factor of a number
- C# program to find Largest, Smallest, Second Largest, Second Smallest in a List
- Java program to find the largest number in an array
- Program to find largest sum of non-adjacent elements of a list in Python
- C program to Find the Largest Number Among Three Numbers
- Find the largest number in a Java array.
- C++ Program to Find ith Largest Number from a Given List Using Order-Statistic Algorithm
- Java Program to find largest prime factor of a number
- Java program to find the 3rd largest number in an array

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

In this article, we will learn about the solution to the problem statement given below.

**Problem statement **− We are given a list, we need to calculate the largest element of the list.

Here we will take the help of built-in functions to reach the solution of the problem statement

# list list1 = [23,1,32,67,2,34,12] # sorting list1.sort() # printing the last element print("Largest element is:", list1[-1])

Largest in given array is 67

# list list1 = [23,1,32,67,2,34,12] # printing the maximum element print("Largest element is:", max(list1))

Largest in given array is 67

We can also take input from the user by the code given below

# empty list list1 = [] # asking number of elements to put in list num = int(input("Enter number of elements in list: ")) # appending elements in the list for i in range(1, num + 1): ele = int(input("Enter elements: ")) list1.append(ele) # print maximum element print("Largest element is:", max(list1))

In this article, we have learned how to get the largest element from the list.

Advertisements