Discuss / Python / 列表生成式

列表生成式

Topic source

浪过扬帆

#1 Created at ... [Delete] [Delete and Lock User]
def FinMaxAndmin(L): 
  return [(m1,m2) for m1 in L if m1 == min(L) for m2 in L if m2 == max(L)][0]

  • 1

Reply