Answer the question
In order to leave comments, you need to log in
Pre and post increment in python?
Is it possible in Python to do something other than i += 1? Or is that the only way to increment? Can't post increment in it?
Answer the question
In order to leave comments, you need to log in
If you mean ++i and i++, then no
++i - this is equivalent to +(+i), which is parsed into i, as a result ++i == i -> True
>>> ++i == i
True
>>> +(+i) == ++i
True
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question