Discuss / Python / 作业

作业

Topic source

柴哲远

#1 Created at ... [Delete] [Delete and Lock User]

def findmaxandmin(L):

    if L==[] :

        return (None, None)   

    min=max=L[0]

    for x in L:

        if max<=x:

            max = x   

        if min>=x:

            min = x

    return(max, min)


  • 1

Reply