egorcr
Junior Member
Posts: 81
|
Post by egorcr on Jul 23, 2022 20:59:11 GMT -5
Hello, where can I read about Lambda functions?
|
|
|
Post by keiezrgas on Jul 23, 2022 21:02:05 GMT -5
Hello, personally, I can advise you to read about Lambda functions and anonymous functions in the "RealPython" blog. Lambda functions are especially useful when we want to send a function as input to another function. We can pass an anonymous lambda function, without assigning it to a variable, as an argument to another function. An example of passing a lambda function as a parameter: Output: The run_task() function shown above is defined with a task parameter that is called as a function inside run_task(). run_task(lambda : print('Task completed!')) calls run_task() with an anonymous lambda function as argument. Python has built-in functions that take other functions as arguments.
|
|