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