In this python basic program, we will solve the given math formula.
Formula : a2 – b2 = (a-b)(a+b)
Steps to solve the program
- Take two variables as input and assign value to them.
- Using logic solve the given math formula.
- Formula : a2 – b2 = (a-b)(a+b)
- Print the output.
a = 3
b = 2
result = (a+b)*(a-b)
print("(a^2-b^2): ",result)
Output :
(a^2-b^2): 5