I have two variables value and run:
value = -9999
run = problem.getscore()
How can I find out which one is greater, and get the greater value?
See also Find the greatest (largest, maximum) number in a list of numbers – those approaches work (and are shown here), but two numbers can also be compared directly.
Use the builtin function
max.Example:
max(2, 4)returns 4.Just for giggles, there’s a
minas well…should you need it. 😛