Discuss / Python / 练习

练习

Topic source
def findMinAndMax(L):
	if L==[]:
		return (None, None)
	n=0
	m=0
	for i in L:
		while L[n]>i:
			n=n+1
		while L[m]<i:
			m=m+1
	return L[n], L[m]

  • 1

Reply