Function to determine list max without itertools

Sayth Renshaw flebber.crue at gmail.com
Fri Apr 19 01:22:06 EDT 2019


> 
> In English rather than Python, how do you find the maximum element in a 
> list?
> 
> -- 
> Rob Gaddi, Highland Technology 

Get first 1 item in the list and compare it to the rest. If it is larger than rest its the max. However if another list member is larger it replaces the first item and comparison continues.

Sayth




More information about the Python-list mailing list