Discuss / Python / 张艾伦

张艾伦

Topic source

```

def findMinAndMax(L): if len(L) == 0: return (None, None) else: min = L[0] max = L[0]

for value in L:
    if value < min:
        min = value
    if value > max:
        max = value

return (min, max)
```python

  • 1

Reply