Discuss / Python / 笔记

笔记

Topic source

容蟹屡

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

    if L==[]:   #注意不是字符串为空

        return (None,None)  #不加括号也可

    else:

        max=min=L[0]

        for i in L:

            while max<i:   #用if也可,用while不可加=

                max=i

            while min>i:

                min=i

        return min,max


  • 1

Reply