KnowledgeBoat Logo

Computer Science

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

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