Discuss / Python / 交作业

交作业

Topic source

rrrr的地盘

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

# -*- coding: utf-8 -*-

def findMinAndMax(L):

    if len(L)==0:

        return('None','None')

    MMin=L[0]

    MMax=MMin

    for i in L[1:]:

        if i<MMin:

            MMin=i

        elif i>MMax:

            MMax=i

    return(MMin,MMax)


  • 1

Reply