+ 1
Why does print(2**1**2) give me 2 in Python 3?
If I raise 2 to power of 1, it's still 2. Then raised to power of 2 it should give me 4. But I get 2.
5 Respuestas
+ 1
Hmm, that's interesting, but why doesn't it follow the usual left-to-right rule? Stacked exponentiation means multiplying the operands of power, which doesn't happen here
+ 1
Михаил Морозов actually in math you also start from the upper power, unless there are parenthesis, same case here
0
Maybe only for power :/
0
Checked for myself, can confirm you're right, Aymane.