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,930 points
37 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,210 points
1,129 views
0 votes
1 answer

how to sort a list of numbers without using built-in functions like min, max or any other function?

Yes it is possible. You can refer ...READ MORE

answered Jun 27, 2019 in Python by Arvind
• 2,980 points
425 views
+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
38 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,740 points
1,815 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,930 points
37 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
40 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,740 points
4,655 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
66 views