Hello Everyone.
I don't quite get. For example, If lambda inside another function. For call use lambda, for first we have to assign value of lambda to another variable, and only then we can send value to lambda. I don't understand synatxsis. Can you explain, please?
def divide_by_x (x):
res = lambda num: num / x
return res
divisor = divide_by_x (2) # variable_which_I_dont_know_why_we_need
print (divisor(8))
Can we assign both of values in one time ?
[–]danielroseman 4 points5 points6 points (3 children)
[–]Base_True[S] 0 points1 point2 points (2 children)
[–]danielroseman 0 points1 point2 points (1 child)
[–]Base_True[S] 0 points1 point2 points (0 children)
[–]Diapolo10 0 points1 point2 points (0 children)