1.

The expression 2**2**3 is evaluates as: (2**2)**3.(a) True(b) FalseI have been asked this question during a job interview.This question is from Precedence and Associativity topic in division Precedence and Associativity, Bitwise & Boolean of Python

Answer»

Correct answer is (b) False

Easiest explanation - The value of the expression (2**2)**3 = 4**3 = 64. When the expression 2**2**3 is evaluated in python, we GET the result as 256, because this expression is evaluated as 2**(2**3). This is because the associativity of EXPONENTIATION OPERATOR (**) is from right to left and not from left to right.



Discussion

No Comment Found

Related InterviewSolutions