Discuss / Python / Answers from Maplin on 2022-11-22

Answers from Maplin on 2022-11-22

Topic source

>>> def findMinAndMax(L):

...     if L == []:

...             return (None, None)

...     else:

...             x, y = L[0], L[0]

...             for n in L:

...                     x = min(x, n)

...                     y = max(y, n)

...             return (x, y)

...


  • 1

Reply