Increment/Decrement operators in Python

Since this post exists, you might be fairly certain that there must be some difference between the increment operators (++ i and i ++) and decrement operators (i-and-i).

Apparently, Python doesn’t like to have multiple ways to do the same thing.

Alternatively, you can use:

In the end, the operators ++ and–are just “shortcuts ”┬áto + = 1 and-1 =.

The following two tabs change content below.
Breno RdV
Please allow me to introduce myself...I'm a former psychologist, with almost a decade worth of experience in Human Resources and People Management. Now a developer/software analyst working with PowerBuilder, C#, PowerShell and currently expanding to the world of Python, Xamarin, PHP Angular and (why not?) Unity.
Breno RdV

Latest posts by Breno RdV (see all)



Posted in Dev, Python and tagged , , , , .