+ 4
How to solve this problem
print( 2 ** 3 ** 2) = 512 đ€·ââïž how
5 RĂ©ponses
+ 5
2^9 right ?
+ 10
2*2*2*2*2*2*2*2*2=512
2 * 1 = 2
2 * 2 = 4
2 * 4 = 8
2 * 8 = 16
2 * 16 = 32
2 * 32 = 64
2 * 64 = 128
2 * 128 =256
2 * 256 =512
+ 6
I, am , to get the correct understanding of this expression, you should keep in mind, that exponentiation starts at the very right side of the expression (this is due to the operator precedence rules ):
2 ** 3 ** 2
THIS IS THE CORRECT WAY:
----------------------------
1. step: 3**2 is calculated -> 9
2. step: 2**9 is calculated -> 512
+ 4
Lothar thanks