Discuss / Python / 交作业

交作业

Topic source

愚者长安

#1 Created at ... [Delete] [Delete and Lock User]
def findMinAndMax(L):
    if L:
        Max, Min = L[0], L[0]
        for i in L:
            if Max < i:
                Max = i
            if Min > i:
                Min = i
        if Max == Min:
            return '数值相等'        
        return Max, Min
    else:
         return '传入为空'  

  • 1

Reply