Computer Science, asked by atharvag5680, 11 months ago

How to use Lambda Function in Python?

Answers

Answered by saranyaammu3
1

Answer:

These are basically anonymous one-line functions created at runtime which are not bound to the name of the functions.

They return the definition of the function on the fly.

Lambda functions don't contain a return statement, they always return an expression.

You can always put a lambda definition anywhere a function is expected.

Suppose we have a function which is to be used only once and called from only one place, then we can use lambda functions.

So you don't need to give it a name and you can define the functionality there itself. Hence, we eliminate the use of a function and use Lambda expression.

SYNTAX :

lambda argument: manipulate(argument)

The given code defines a lambda function that gives the following output

add = lambda x, y: x + y

print(add(4, 6))

OUTPUT

10

Explanation:

Answered by MERCTROOPER
0

Explanation:

Ohm's Law is a formula used to calculate the relationship between voltage, current and resistance in an electrical circuit. To students of electronics, Ohm's Law (E = IR) is as fundamentally important as Einstein's Relativity equation (E = mc²) is to physicists. E = I x R.

Similar questions