?
Which one of the following has the same precedence level?
Answer & Solution
Correct Answer:
Option
A
In Python, Addition (+) and Subtraction (-) operators have the same precedence level.
Multiplication (*) and Division (/) operators have a higher precedence than Addition and Subtraction.
When an expression contains operators with the same precedence, they are evaluated from left to right.
For example, in the expression 3 + 5 - 2, the addition and subtraction are performed from left to right.
Multiplication (*) and Division (/) operators have a higher precedence than Addition and Subtraction.
When an expression contains operators with the same precedence, they are evaluated from left to right.
For example, in the expression 3 + 5 - 2, the addition and subtraction are performed from left to right.
Join the Discussion
Login to post a comment or share your explanation.
Login