λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°

University of California, Berkeley/ElectricalEngineering & ComputerSciences

LAB_day 2

Lambdas

-   define functions

   lambda <param>: <return>

-   almost identical to def-statement except

: no intrinsic name

: limited to 1 expression

python codes ex.

def add_three(x) :

   return x + 3

python codes ex.

add_three = lambda x: x+3

 

Higher Order Functions

-   Functions that either

: takes in a function as an argument

: returns a function

python codes ex.

def lemon(bar):

  def ice(cream):

    return bar + cream

  return ice

 

'University of California, Berkeley > ElectricalEngineering & ComputerSciences' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

textbook _ mid  (0) 2019.07.03
Recursion  (0) 2019.07.03
Higher-Order Functions  (0) 2019.07.02
Week 2  (0) 2019.07.02
Environment Diagrams  (0) 2019.06.28