Discuss / Python / 遍历

遍历

Topic source

阿羊羽

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

```

if L == []:

        return(None, None)

    else:

        max = L[0]

        min = L[0]

        for x in L[1:]:

            if x > max:

                max = x

            elif x < min:

                min = x

        return(min, max)

```


  • 1

Reply