in Python by
What Are The Principal Differences Between The Lambda And Def?

1 Answer

0 votes
Lambda Vs. Def.

Def can hold multiple expressions while lambda is a uni-expression function.

Def generates a function and designates a name to call it later. Lambda forms a function object and returns it.

Def can have a return statement. Lambda can’t have return statements.

Lambda supports to get used inside a list and dictionary.

Related questions

0 votes
asked May 16, 2020 in Python by Robindeniel
0 votes
asked Dec 31, 2020 in Python by SakshiSharma
0 votes
asked Oct 12, 2021 in Python by rajeshsharma