Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to find greatest number in python

Method 1 : Sort the list in ascending order and print the last element in the list.

filter_none
edit
play_arrow

brightness_4
# Python program to find largest 
# number in a list 
  
# list of numbers 
list1 = [10, 20, 4, 45, 99] 
  
# sorting the list 
list1.sort() 
  
# printing the last element 
print("Largest element is:", list1[-1]) 
Output:

Largest element is: 99
Comment

PREVIOUS NEXT
Code Example
Python :: get ip address 
Python :: api testing python 
Python :: i++ in python 
Python :: convolution operation pytorch 
Python :: list peek python 
Python :: change part of a text file python 
Python :: how to split a string by space in python 
Python :: how to turn a string into an integer python 
Python :: creating a dictionary 
Python :: join multiple excel files with python 
Python :: get the first item in a list in python 3 
Python :: Example of break, continue and pass statements in python 
Python :: simple python class 
Python :: convert a list to tuple 
Python :: Removing Elements from Python Dictionary Using pop() method 
Python :: python remove the element in list 
Python :: any all in python 
Python :: map vs apply pandas 
Python :: stack python 
Python :: os.path.join 
Python :: string representation of date time 
Python :: python language 
Python :: models django 
Python :: pdf to word 
Python :: python print new line 
Python :: service 
Python :: string pythhon 
Python :: pandas idxmax 
Python :: dot product of lists python 
Python :: python def example 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =