當前位置:編程學習大全網 - 電腦編程 - 問下這個python 的code 怎麽寫~~~

問下這個python 的code 怎麽寫~~~

#python 3.2

def clean_up(alist, list_threshold):

return list(filter(lambda e:len(e[1])<=list_threshold, alist))

L = [["medium", [9, 3]], ["long", [1, 2, 3, 4]], ["short", [8]]]

result = clean_up(L, 2)

print(result)

print('same_alist(result,'+repr(result)+')')

============

[['medium', [9, 3]], ['short', [8]]]

same_alist(result,[['medium', [9, 3]], ['short', [8]]])

  • 上一篇:醫學生會到舟山普陀島上工作嗎知乎
  • 下一篇:java編程:我在做壹個上傳文件的下載,下載方法返回的是InputStream類型,這樣的話如果文件存在,點擊
  • copyright 2024編程學習大全網