How to find the maximum of 2 numbers?
value = -9999
run = problem.getscore()
I need to compare the 2 values i.e value
and
Use the builtin function max.
Example:
max(2, 4)
returns 4.
Just for giggles, there's a min
as well...should you need it. :P
numberList=[16,19,42,43,74,66]
largest = numberList[0]
for num2 in numberList:
if num2 > largest:
largest=num2
print(largest)
gives largest number out of the numberslist without using a Max statement
max(number_one, number_two)
max()
(num1>=num2)*num1+(num2>num1)*num2
will return the maximum of two values.
max(value,run)
should do it.