Computer Science
What is the value of x?
x = int(13.25 + 4/2)
- 17
- 14
- 15
- 23
Python Funda
2 Likes
Answer
15
Reason — According to operator precedence, division will be done first followed by addition and then it will convert to integer.
x = int(13.25 + 4/2)
x = int(13.25 + 2.0)
x = int(15.45)
x = 15
Answered By
1 Like
Related Questions
What will be the value of the expression?
14 + 13 % 15- 14
- 27
- 12
- 0
Evaluate the expression given below if A = 16 and B = 15.
A % B // A- 0.0
- 0
- 1.0
- 1
The expression 8/4/2 will evaluate equivalent to which of the following expressions:
- 8/(4/2)
- (8/4)/2
Which among the following list of operators has the highest precedence?
+, -, **, %, /, <<, >>, |
- <<, >>
- **
- I
- %