๐ŸŒ
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

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
python - Get max value from a list with lists? - Stack Overflow
yess what I mean is that if you would have a list [["1", "1", "a", 10, 8.3931], ....] like that one, it would still return 8.3 instead of 10 right ? 2020-07-21T16:56:57.483Z+00:00 ... Correct. sublist[-1] returns the last value in each sublist. It has nothing to do with sortedness. 2020-07-21T21:32:52.283Z+00:00 ... Save this answer. ... Show activity on this post. In perhaps a more functional than pythonic manner: Copy>>> max... More on stackoverflow.com
๐ŸŒ stackoverflow.com
min() vs 'sort() and then list[0]'

As others have mentioned, min will be quicker. min just has to walk through the list once, whereas sort must do more compares, making it more complex.

However, one case you might want to use sort is when you need more than just the minimum. Eg. you want the 5 smallest items, not just the smallest. Here "sorted(mylist)[:5]" will do the job, but another option to keep in mind is the heapq module, as "heapq.nsmallest(5, mylist)" will often perform better than sort, at least for a small number of items.

More on reddit.com
๐ŸŒ r/Python
36
29
February 23, 2012
How do I find the relative maximum in a function?
Take the derivative and find where it equals zero. Also, do your calculus homework using calculus! But seriously - give us more context. You really can use numpy/scipy to get a derivative, or you can scan the function with some arbitrary input, or you can ask questions we can't answer without proper setup. WHY are you trying to find a local maxima? What inputs do you have? What context is this in? More on reddit.com
๐ŸŒ r/Python
7
1
January 23, 2014
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_func_max.asp
Python max() Function
Remove List Duplicates Reverse ... Q&A Python Training ... The max() function returns the item with the highest value, or the item with the highest value 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?

๐ŸŒ
Pierian Training
pieriantraining.com โ€บ home โ€บ understanding the max python function
Understanding the Max Python Function - Pierian Training
May 28, 2023 - When working with lists, you might need to find the maximum value in the list. Thankfully, Python provides several ways to accomplish this task. The easiest way to find the maximum value in a list is to use the built-in `max()` function.
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ python-max-list-function
Python max list Function
March 31, 2025 - The Python max is one the List function used to return the maximum value. The syntax of Python list function is max(name).
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ methods โ€บ built-in โ€บ max
Python max()
key (optional) - key function where the iterables are passed and comparison is performed based on its return value ยท default (optional) - default value if the given iterable is empty ยท max() returns the largest element from an iterable. ... If the items in an iterable are strings, the largest ...
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ python โ€บ built-in โ€บ max()
Python max() - Find Maximum Value
September 27, 2024 - Prepare a list containing string elements. Apply the max() function to find the string that comes last alphabetically.
Find elsewhere
๐ŸŒ
Spark By {Examples}
sparkbyexamples.com โ€บ home โ€บ python โ€บ python list max() function
Python List max() Function - Spark By {Examples}
May 31, 2024 - The max() function is a built-in function in Python that is used to find the maximum element in a list, tuple, or any other iterable object. It takes the
๐ŸŒ
Pythontic
pythontic.com โ€บ containers โ€บ list โ€บ max
max() function of list in Python | Pythontic.com
The max() function returns the maximum of the elements present in a Python list.
๐ŸŒ
Interview Kickstart
interviewkickstart.com โ€บ home โ€บ blogs โ€บ learn โ€บ max() function in python: syntax, parameters, and examples
max() Function in Python: Syntax, Parameters & Examples
April 1, 2026 - The max() function in Python is a built-in function that returns the largest value from either an iterable (like a list or tuple) or from multiple arguments passed directly.
๐ŸŒ
Real Python
realpython.com โ€บ python-min-and-max
Python's min() and max(): Find Smallest and Largest Values โ€“ Real Python
October 22, 2025 - You pass the list as an argument to Pythonโ€™s built-in min() function to find the smallest value and to max() to find the largest value.
๐ŸŒ
Finxter
blog.finxter.com โ€บ home โ€บ learn python blog โ€บ python list max()
Python List max() - Be on the Right Side of Change
July 1, 2020 - The return value of the max(list) function is a single element from the list that is the maximum of all elements. If the list is empty, the default object is returned, if explicitly defined.
๐ŸŒ
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 - The Python max() function is used to find the largest value in a list of values. The Python min() function is used to find the lowest value in a list.
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ python-max-function
Python max Function
December 29, 2018 - The Python max function is used to find the largest item of a given object or, max returns the highest element in a tuple, list, string, etc.
๐ŸŒ
Learn By Example
learnbyexample.org โ€บ python-max-function
Python max() Function - Learn By Example
April 20, 2020 - The max() function can find the largest of two or more values (such as numbers, strings etc.) or the largest item in an iterable (such as list, tuple etc.)
๐ŸŒ
PyTutorial
pytutorial.com โ€บ find-maximum-in-python-list-methods-examples
PyTutorial | Find Maximum in Python List: Methods & Examples
January 26, 2026 - The simplest way is using Python's max() function. It is built-in and highly efficient. You pass your list as an argument.
๐ŸŒ
ThePythonGuru
thepythonguru.com โ€บ python-builtin-functions โ€บ max
Python max() function - ThePythonGuru.com
January 7, 2020 - The max() function returns the largest of the input values.Its syntax is as follows:max(iterable[, default=obj, key=func]) -> value PARAMETER โ€ฆ