Some of the more complex formulas require some operations to be performed first, and others afterward. In math, we prioritize them with parentheses.
In this formula,
a + b - cneeds to be performed before the multiplication, and the subtraction of
2needs to happen in the end.
In math, the top priority is given to parentheses, then exponentiation, then multiplication or division, then addition or subtraction.
Python follows the same priority order. The order of priorities for arithmetic operations is:
- Multiplication and division
- Addition and subtraction
Knowing this, your task is to calculate a complex formula, given
bintegers as an input:
Print the value of
yin the output.