Discuss / Python / 作业

作业

Topic source

warmscar

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

def findMinAndMax(L):

  if not L:

    return (None, None)

  min, max = L[0], L[0]

  for i in L:

    if i < min: min = i

    if i > max: max = i

  return (min, max)


  • 1

Reply