written in python "seeking the maximum value"

# Selecting the maximum value 
DEF Large (NUM *):    # define a function, a variable parameter argument function is 
    m = 0
     for n- in NUM:
         IF m> n-:   # parameters pairwise comparison 
            mA = m   # The maximum value to a variable 
        the else : 
            mA = n- 
            m = n-
     return mA   # returns the maximum 


Print (Large (-234 567, 1231 of, 345, 444, 199 111, 0, -445 666, 6666))

 

Guess you like

Origin www.cnblogs.com/lengjf/p/11073610.html