Computer Science
The expression 8/4/2 will evaluate equivalent to which of the following expressions:
- 8/(4/2)
- (8/4)/2
Python Funda
5 Likes
Answer
(8/4)/2
Reason — As both the operators are division operators, the expression will be evaluated from left to right.
8/4/2 = 2/2 = 1.0
(8/4)/2
= 2/2
= 1.0
Answered By
2 Likes
Related Questions
Evaluate the expression given below if A = 16 and B = 15.
A % B // A- 0.0
- 0
- 1.0
- 1
What is the value of x?
x = int(13.25 + 4/2)- 17
- 14
- 15
- 23
Which among the following list of operators has the highest precedence?
+, -, **, %, /, <<, >>, |
- <<, >>
- **
- I
- %
Which of the following expressions results in an error?
- float('12')
- int('12')
- float('12.5')
- int('12.5')