Today i am posting a python program to solve the expression (a+b)*(a+b).
|(5 + 7) ^ 2) = 144|
Here we initialized two variables ‘a’ and ‘b’. The equation (a+b)*(a+b) can be written in the form of (a+b)2. So the equation can be written as a * a + 2 * a * b + b * b. The output is stored in the variable result. Finally it prints the result of (a+b)*(a+b).
Similarly we can also write a program to solve the equation (a+b+c)2
|(5 + 7 + 2) ^ 2) = 196|
Similarly try for the following equations.