Question-60: What would be printed when below code snippet is executed?
print( 2*4%7)
- 0
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering Python Certification Material
Answer : B
Exp:
Operator Precedence
- As you can remember, multiplication has higher priority than addition.
- You should always consider operator binding, when there are same precedence operators.
- Priority-1: + and – (Unary Operator)
-
You can access to full explanation to question and answer from this page.