Discuss / Python / 作业

作业

Topic source

XNOKIA

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

```

def findMaxAndMin(L):

if L == []:

return (None, None)

max = L[0]

min = L[0]

for x in L:

min = x if x<min else min

max = x if x>max else max

return (min, max)

```

XNOKIA

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

markdown 失效了?


  • 1

Reply