CBSE Class 12 Computer Science Question 25 of 105

Python Revision Tour — Question 9

Back to all questions
9
Question

Question 9

What is the value of x?
    x = int(13.25 + 4/2)

  1. 17
  2. 14
  3. 15
  4. 23
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