Discuss / Python / 打卡

打卡

Topic source

v贝塔v

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

看来大家写得都差不多

def findMinAndMax(L):
	if(len(L)):
		min,max= L[0],L[0]
		for num in L[1:]:
			if min > num:
				min = num
			if max < num:
				max = num
		return(min,max)
	return (None,None)

  • 1

Reply