Using lambda functions to solve Algebra

0 votes
How can python lambda functions be used to solve Algebraic equations?
Jun 17 in Python by Wajiha
• 1,120 points
13 views

1 answer to this question.

0 votes

Python lambda functions can be used to solve algebraic expressions as follows:

Linear Equations:

As we all know, linear equations are equations with degree one. For example 2x+3y. Now let's solve the same using lambda functions

Example:

s=lambda x,y: 2*x+3*y
s(3,5)

Output: 21

Quadratic Equations:

These are equations with degree 2. For example (x+y)^2

EXAMPLE:

s=lambda x,y: (x+y)**2
s(3,5)

OUTPUT: 64

answered Jun 17 by anonymous

Related Questions In Python

0 votes
1 answer

How can I write a program to add two numbers using functions in python?

def add(a,b):      return a + b #when i call ...READ MORE

answered May 20 in Python by Mohammad
• 1,500 points
23 views
0 votes
1 answer
+2 votes
2 answers

How to make a laplacian pyramid using OpenCV python?

down voteacceptTheeThe problem is that you're iterating ...READ MORE

answered Apr 3, 2018 in Python by charlie_brown
• 7,710 points
1,096 views
0 votes
2 answers

how to print the current time using python?

print(datetime.datetime.today()) READ MORE

answered Feb 14 in Python by Shashank
• 1,350 points
33 views
0 votes
1 answer

Why are Python lambdas useful?

The main purpose of anonymous functions come ...READ MORE

answered Jun 19 in Python by Wajiha
• 1,120 points
20 views
0 votes
1 answer

How Lambda() is used with filter() in python?

The filter() function in Python takes in ...READ MORE

answered May 20 in Python by Rakshi
15 views
0 votes
1 answer

What happens when you use lambda inside lambda?

Yes you can use lambda inside lambda. ...READ MORE

answered Jun 19 in Python by Wajiha
• 1,120 points
11 views
0 votes
1 answer
0 votes
1 answer

What is the purpose of using lambda functions in Python?

The main purpose of anonymous functions come ...READ MORE

answered Jun 11 in Python by Nisa
• 1,090 points
26 views