Discuss / Python / 要严格注意是否对齐

要严格注意是否对齐

Topic source

伏瑞斯

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

if L == []:

    return (None,None)

  else:

    f_min = f_max=L[0]

    for i in L:

        # 判断小数

        if i < f_min:

            f_min = i

        # 判断大数

        if i > f_max:

            f_max = i

    return (f_min,f_max)

伏瑞斯

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

  if L == []:

    return (None,None)

  else:

    a1 = a2=L[0]

    for i in L:

       while a1>i:

          a1=i

       while a2<i:

          a2=i

    return (a1,a2)


  • 1

Reply