Contents

What will be the value of the following Python expression?
a) 3                                                        
b) 7
c) 77                                      
d) 0

b

Explanation: The order of precedence is: **, //, +. The expression 4+2**5//10 is evaluated as 4+32//10, which is equal to 4+3 = 7. Hence the result of the expression shown above is 7.


The expression 2**2**3 is evaluates as: (2**2)**3.
a) True                                  
b) False

b

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.