close

[python]lambda map


lambda arguments: expression


其實等於下面這個樣式

 


def name(arguments):
return expression



舉個例來說:


lambda x :x+1

def fuc(x):
return x+1



一句話表示: lambda就是 先接傳入參數 冒號 然後運算式

[相關資料]








arrow
arrow
    創作者介紹
    創作者 peicheng 的頭像
    peicheng

    FLASHC

    peicheng 發表在 痞客邦 留言(0) 人氣()