How do I find the maximum of 2 numbers?

后端 未结 10 1981
借酒劲吻你
借酒劲吻你 2020-12-03 02:22

How to find the maximum of 2 numbers?

value = -9999
run = problem.getscore()

I need to compare the 2 values i.e value and

10条回答
  •  暖寄归人
    2020-12-03 02:43

    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

提交回复
热议问题