I think the accepted answer is great, but why don't you do it explicitly? I feel more people would understand your code, and that is in agreement with PEP 8:

max_value = max(my_list)
max_index = my_list.index(max_value)

This method is also about three times faster than the accepted answer:

import random
from datetime import datetime
import operator

def explicit(l):
    max_val = max(l)
    max_idx = l.index(max_val)
    return max_idx, max_val

def implicit(l):
    max_idx, max_val = max(enumerate(l), key=operator.itemgetter(1))
    return max_idx, max_val

if __name__ == "__main__":
    from timeit import Timer
    t = Timer("explicit(l)", "from __main__ import explicit, implicit; "
          "import random; import operator;"
          "l = [random.random() for _ in xrange(100)]")
    print "Explicit: %.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000)

    t = Timer("implicit(l)", "from __main__ import explicit, implicit; "
          "import random; import operator;"
          "l = [random.random() for _ in xrange(100)]")
    print "Implicit: %.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000)

Results as they run in my computer:

Explicit: 8.07 usec/pass
Implicit: 22.86 usec/pass

Other set:

Explicit: 6.80 usec/pass
Implicit: 19.01 usec/pass
Answer from Escualo on Stack Overflow
🌐
Tutorialspoint
tutorialspoint.com › python › list_max.htm
Python List max() Method
The Python List max() method compares the elements of the list and returns the maximum valued element. If the elements in the list are numbers, the comparison is done numerically; but if the list contains strings, the comparison is done
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-list-max-method
Python List max() Method - GeeksforGeeks
July 23, 2025 - max() function in Python is a built-in function that finds and returns the largest element from the list.
Discussions

python - Pythonic way to find maximum value and its index in a list? - Stack Overflow
Well, the speed of numpy.argmax looks amazing until you let it process a standard python list. Then the speed lies between explicit and implicit version. I guess np.array does not just create a list but it saves some extra info in it - like for example min and max values (just a hypothesis). More on stackoverflow.com
🌐 stackoverflow.com
finding max in list
the max() function is a builtin. More on reddit.com
🌐 r/learnpython
7
1
December 19, 2020
for loop - How to find the index of the max value in a list for Python? - Stack Overflow
I have a list, and I need to find the maximum element in the list and also record the index at which that max element is at. This is my code. list_c = [-14, 7, -9, 2] max_val = 0 idx_max = 0 for ... More on stackoverflow.com
🌐 stackoverflow.com
how to find maximum from a list using a for loop in pythonic way?
but I want to use a syntax like this: var = max(item) for item in lst That doesn't look pythonic to me. In fact, it's not even right Python syntax. More on reddit.com
🌐 r/learnpython
55
5
June 27, 2023
🌐
TutorialsPoint
tutorialspoint.com › article › find-the-index-of-maximum-item-in-a-list-using-python
Find the Index of Maximum Item in a List using Python
August 14, 2023 - The program uses the built?in function max() to find the maximum item in a list using Python.
🌐
Python documentation
docs.python.org › 3 › library › functions.html
Built-in Functions — Python 3.14.3 documentation
1 month ago - The key argument specifies a one-argument ordering function like that used for list.sort(). The default argument specifies an object to return if the provided iterable is empty. If the iterable is empty and default is not provided, a ValueError is raised. If multiple items are maximal, the function returns the first one encountered.
🌐
LabEx
labex.io › tutorials › index-of-max-element-13687
Index of Max Element in Python | LabEx
Write a function max_element_index(arr) that takes a list arr as an argument and returns the index of the element with the maximum value.
Find elsewhere
🌐
Medium
medium.com › @antash › six-ways-to-find-max-value-of-a-list-in-python-b7d7ccfabc0d
Six ways to find max value of a list in Python | by Tomasz Wąsiński | Medium
November 16, 2016 - Sometime ago I read similar article on JavaScript, I thought that it would be a nice little challenge to came up with couple of Python solutions on this topic. ... Using builtin max() function is most pythonic and the best solution in 99.5% of cases (I checked!
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › find maximum value in list in python
Find Maximum Value in List in Python - Spark By {Examples}
May 31, 2024 - For instance, the max() function is used to find the largest string in the list mylist. The strings are compared alphabetically, and the largest string is determined to be ‘Python‘.
🌐
Reddit
reddit.com › r/learnpython › finding max in list
r/learnpython on Reddit: finding max in list
December 19, 2020 -
#I have 2 lists. First, i need to find the max value in list one. the value i want #from list 2 should be the one found in the same index as the max in list one. 

#example: since 135 is larger, i want to return 15
#because 135 is index 1, and 15 is index 1.
LIST_1 = [101,135]
LIST_2=[20,15]

#i would really appreciate any help, any hints! :D
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-maximum-minimum-elements-position-list
Position of maximum and minimum element in a list - Python - GeeksforGeeks
April 14, 2025 - The easiest way to find the position of the maximum and minimum elements in a list is by using Python's built-in max() and min() functions along with index():
🌐
W3Schools
w3schools.com › python › ref_func_max.asp
Python max() Function
Remove List Duplicates Reverse ... Python Certificate Python Training ... The max() function returns the item with the highest value, or the item with the highest value in an iterable....
🌐
Python
docs.python.org › 3 › library › itertools.html
itertools — Functions creating iterators for efficient looping
1 month ago - To compute a running minimum, set function to min(). For a running maximum, set function to max(). Or for a running product, set function to operator.mul(). To build an amortization table, accumulate the interest and apply payments: >>> data ...
🌐
Hyperskill
hyperskill.org › university › python › max-in-python
Python max()
December 25, 2025 - The max() function finds the maximum value among elements of an iterable or a series of arguments. It returns the largest item based on the default ordering or a custom ordering specified by the optional key parameter. When used with iterables like lists or tuples, the function compares the ...
🌐
PythonForBeginners.com
pythonforbeginners.com › home › find the index of max value in a list in python
Find the Index of Max Value in a List in Python - PythonForBeginners.com
May 23, 2022 - In this article, we have discussed different ways to find the index of max value in a list in python. If you need to find only the index of the first occurrence of the max value, you can use the approach with the max() function and the index() method.
🌐
Programiz
programiz.com › python-programming › methods › built-in › max
Python max()
Become a certified Python programmer. Try Programiz PRO! ... The max() function returns the largest item in an iterable.
🌐
Reddit
reddit.com › r/learnpython › how to find maximum from a list using a for loop in pythonic way?
r/learnpython on Reddit: how to find maximum from a list using a for loop in pythonic way?
June 27, 2023 -

lst = [1,2,3,4,5]

basically, I want to find max: max(lst)

but I want to use a syntax like this: var = max(item) for item in lst

first, why does this return a generator object instead of throwing some error?

And second, how to do it properly?

Edit: so basically there is a function. I need to compute the max value returned by the function. The function should calculate values from a list of inputs.

So, I need to de this:

var = max(func(item)) for item in lst

I just wanted to know if we can do this in one or two liner?

🌐
Career Karma
careerkarma.com › blog › python › python min and max: the ultimate guide
Python Min and Max: The Ultimate Guide | Career Karma
December 1, 2023 - Then, we use the min() method to ... price available was $3.26 per gallon of milk. The Python max() function returns the largest value in an iterable, such as a list....
🌐
Real Python
realpython.com › python-min-and-max
Python's min() and max(): Find Smallest and Largest Values – Real Python
January 18, 2025 - Python’s built-in functions max() and min() allow you to find the largest and smallest values in a dataset. You can use them with iterables, such as lists or tuples, or a series of regular arguments. They can handle numbers, strings, and even dictionaries.
🌐
Vultr Docs
docs.vultr.com › python › built-in › max
Python max() - Find Maximum Value | Vultr Docs
September 27, 2024 - Here, max() uses a lambda function to compare fruits based on their 'weight' attribute. The output will show apple as it has the highest weight in the list. The max() function in Python provides a straightforward, yet powerful means of finding the maximum value across various data structures.