if L != [] :
(min,max) = (L[0],L[0])
for x in L:
if x < min:
min = x
if x > max:
max = x
return (min,max)
else:
return (None, None)
考察 for in 的使用问题,冒号容易忘记
if L != [] :
(min,max) = (L[0],L[0])
for x in L:
if x < min:
min = x
if x > max:
max = x
return (min,max)
else:
return (None, None)
考察 for in 的使用问题,冒号容易忘记