我是Python的新手。当我看到这个的时候,我正在用python学习算术。
5**(5+5)等于9765625,而(5+5)**5等于100000
为什么会发生这种事?
我正在使用Python3.4.0
发布于 2014-04-23 03:32:43
**用于表示“升为”的幂
a**b --> a raised to the power of b因此,10**5和5**10是不同的,给出了不同的结果。
>>> 10**5
100000
>>> 5**10
9765625这是因为python首先评估(5+5)。
5**(5+5) --> 5**10 --> 9765625鉴于
(5+5)**5 --> 10**5 --> 100000https://stackoverflow.com/questions/23234242
复制相似问题