Discuss / Python / 复习python基础知识,打卡第四天

复习python基础知识,打卡第四天

Topic source

飞云

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

>>> def findMinAndMax(L):

if L == []:

return (None, None)

L_max = L[0]

L_min = L[0]

for i in range(len(L)):

if L_max < L[i]:

L_max = L[i]

elif L_min > L[i]:

L_min = L[i]

return (L_min, L_max)


  • 1

Reply