0

If I perform multiple arithmetic operations without using parenthesis to define the order, does python follow the BODMAS rule?

11/1/2016 3:43:35 AM

Sabin

1 Answer

New Answer

+3

In such case precedence rules will be applied. For Example 2* 5 +10 multiple has higher precedence than addition so first of all 2*5 will be solved first and then will add to ten. Below link has complete table of procesence for python https://www.tutorialspoint.com/python/operators_precedence_example.htm One more thing If same arithmetic operators are used then left to right rule will be applied in such cases. like 2*5*10-50 so using left to right 2*5 will solve first 10*10-50 # now multiply has higher precedence so 100-50 50