To find the largest in a list you do not need to see them all at once. Hold a "largest so far"; at each new element compare: if it is larger, it takes the place.
best = values[0]for v in values:if v > best:best = vreturn best
values[0] is the list's first element (counting starts at 0). Starting the search with a value from the list keeps the answer from being a number that is not in it.The same idea finds the smallest, the last one seen, the longest. You can carry two things at once: two variables for the smallest and the largest, one loop.