I just played with the python command line and the ** operator, which, as far as I know, performs a power function. So, 2 ** 3 must be (and is) 8, because 2 * 2 * 2 = 8.
Can someone explain the behavior I found? I see no way to group parenthesized operations to get the result of 65536, as was achieved here.
>>> 2 ** 2 ** 2
16
>>> 2 ** 2 ** 2 ** 2
65536
>>> (2 ** 2 ** 2) ** 2
256
source
share