PDA

View Full Version : Highest num in list Python



matmatmat
July 15th, 2009, 04:14 PM
How can I get the highest number from a list in python without mixing up the order?

monraaf
July 15th, 2009, 04:17 PM
Use the max function.

The Cog
July 15th, 2009, 05:22 PM
Use the max function.
Like this:


>>> numbers = [5, 7, 2, 54, 23, 6, 21]
>>> max(numbers)
54
>>>