0

I've encounter ++ operator in python, I would expect SyntaxError, but instead it seems like doing nothing, especially isn't incrementing value like in c++, java etc.

>>> ++3
3
>>> a = 4
>>> ++a
4
>>> a
4

Could someone explain what this does or what operations are hidden beneath this kind of operation?

(Code tested in python 3.8 IDLE)

Guaz
  • 183
  • 1
  • 1
  • 12

0 Answers0