Operator precedence in Python -PEMDAS

对着背影说爱祢 提交于 2019-12-02 04:27:23

* has the same operator precedence as /. Operators in the same group evaluate left to right, so your expression evaluates as:

6*2 = 12
/ 1 = 12
* 2 = 24

Order of precedence in Python

P

E

M D Left to right

A S Left to right

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!