CBSE Class 12 Computer Science Question 26 of 105

Python Revision Tour — Question 10

Back to all questions
10
Question

Question 10

The expression 8/4/2 will evaluate equivalent to which of the following expressions:

  1. 8/(4/2)
  2. (8/4)/2
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