The difference between java and python++ operators

I learned java first, then python.
I ran into a pit today.
It's the ++ and – operators.
In java, ++a, is to increase a by 1, and then return the value after the increase.
But in python, ++ is two plus signs, so the value of the variable will not change.
In addition, in python, a++ will report a syntax error.
– The same is true. In python, -a is negative or positive, so return a directly. The a- will report a syntax error.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324781114&siteId=291194637