What Is The Associativity Of Python's ** Operator?
I was just playing around with the python command line and the ** operator, which as far as I know performs a power function. So 2 ** 3 should be (and is) 8 because 2 * 2 * 2 = 8.
Solution 1:
2** (2**(2**2))
from http://docs.python.org/reference/expressions.html
Operators in the same box group left to right (except for comparisons, including tests, which all have the same precedence and chain from left to right — see section Comparisons — and exponentiation, which groups from right to left).
Post a Comment for "What Is The Associativity Of Python's ** Operator?"