Is there any easy way or function to determine the greatest number in a python list? I could just code it, as I only have three numbers, however it would make the code a lot
You can actually sort it:
sorted(l,reverse=True)
l = [1, 2, 3] sort=sorted(l,reverse=True) print(sort)
You get:
[3,2,1]
But still if want to get the max do:
print(sort[0])
3
if second max:
print(sort[1])
and so on...