def find(L):
if L==[]:
return(None,None)
else:
s=L[0]
x=L[0]
for i in L:
if i>=s:
s=i
elif i<=x:
x=i
return(x,s)
Sign in to make a reply
用户6329855348
def find(L):
if L==[]:
return(None,None)
else:
s=L[0]
x=L[0]
for i in L:
if i>=s:
s=i
elif i<=x:
x=i
return(x,s)