Using lambda functions to solve Algebra

0 votes
How can python lambda functions be used to solve Algebraic equations?
Jun 17, 2019 in Python by Wajiha
• 1,950 points
158 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, 2019 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, 2019 in Python by Mohammad
• 3,230 points
5,196 views
0 votes
2 answers
+1 vote
1 answer

how to run list of functions using Thread?

You could import the file with function ...READ MORE

answered Aug 26, 2019 in Python by Vishaka
56 views
+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,770 points
2,450 views
0 votes
1 answer

Why are Python lambdas useful?

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

answered Jun 19, 2019 in Python by Wajiha
• 1,950 points
50 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, 2019 in Python by Rakshi
58 views
0 votes
1 answer

How can I write code to find a palindrome in python without using string functions?

In Logic 1, try if i<int(length/2): instead of if i<int((length/2+1)): In ...READ MORE

answered Jan 16, 2019 in Python by charlie_brown
• 7,770 points
6,795 views
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, 2019 in Python by Nisa
• 1,090 points
115 views