How to find the greatest number in a list in Python

0 votes
Is there any easy way or a builtin function to determine the greatest number in a python list? Can we find it without using builtin functions?
Aug 21, 2019 in Python by Arvind
• 3,050 points
2,866 views

1 answer to this question.

0 votes

1. By using max function - 

highest = max(11, 21, 31) 
print(highest) # prints 31

2. Without using max function

a=[11,22,33,44,66,77,99,88,999]
max= 0
for i in a:
    if i > max:
        max=i
print(max) # prints 999
answered Aug 21, 2019 by Neel
• 3,020 points

Related Questions In Python

–1 vote
2 answers

How to find the size of a string in Python?

following way to find length of string  x ...READ MORE

answered Mar 29, 2019 in Python by rajesh
• 1,270 points
2,107 views
+1 vote
1 answer
0 votes
1 answer

How can I find the square of a number in python?

You can use the exponentiation operator or ...READ MORE

answered May 21, 2019 in Python by Mohammad
• 3,230 points
1,227 views
0 votes
1 answer

How to find the value of a row in a csv file in python?

If you want to find the value ...READ MORE

answered May 20, 2019 in Python by Sanam
19,219 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,070 views
0 votes
1 answer

How to get permutations of list or a set in Python?

Permutation is an arrangement of objects in ...READ MORE

answered Jul 11, 2019 in Python by Neel
• 3,020 points
8,898 views
0 votes
1 answer

How to add elements to a list in Python?

To initialize an empty list do this: new_list ...READ MORE

answered Jul 23, 2019 in Python by Neel
• 3,020 points
785 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP