Discuss / Python / 作业打卡

作业打卡

Topic source

石年80059

#1 Created at ... [Delete] [Delete and Lock User]
def findMinAndMax(L):    if len(L) == 0:        print('L is kong')    if len(L) == 1:        min = max = L[0]    if len(L) == 2:        if L[0] >= L[1]:            max = L[0]            min = L[1]        else:            max = L[1]            min = L[0]    else:        for i in range(3,len(L)):            if L[0] >= L[1]:                max = L[0]                min = L[1]            else:                max = L[1]                min = L[0]            tmp = L[i]            if tmp < min:                min = tmp            elif tmp > max:                max = tmp    return min, maxa = [1,5,2,7,3,8,10]print(findMinAndMax(a))

石年80059

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

为什么以发布就完全乱格式了???


  • 1

Reply