Discuss / Python / 练习

练习

Topic source

    if len(L)==0:

     return (None, None)

    elif len(L)==1:

     return(L[0],L[0])

    else:

     max=L[0]

     min=L[0]

     for n in L:

      if n>max:

       max=n

      if n<min:

       min=n

     return(min,max)


  • 1

Reply