Python has no ++ or -- increment/decrement operator. To change an ordinary numeric variable by one, use x += 1 or x -= 1. The explicit alternatives are x = x + 1 and x = x - 1.
How to increment or decrement a Python variable
Use augmented assignment for the usual case:
count = 4
count += 1 # count is now 5
count -= 1 # count is now 4
+= and -= are augmented assignment operators: they perform an operation and assign its result to the target. For a simple integer variable, these forms clearly express adding or subtracting one. The Python Language Reference describes x += 1 as similar to x = x + 1, but cautions that the effects are not exactly equal in every case.
Why Python does not use ++ or —
Python’s operator-token inventory includes +, -, += and -=, but not ++ or -- as operators. The complete inventory is in the Python Language Reference’s lexical analysis section.
Unary plus is not an increment operation either: +x is a unary arithmetic expression, not an assignment that changes x. To increment the variable, use an assignment such as x += 1. Python’s data model documents unary arithmetic and augmented arithmetic operations separately.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
When += and = x + 1 can behave differently
For a simple integer variable, x += 1 and x = x + 1 are usually interchangeable in practice. But augmented assignment evaluates its target once and, when the target’s type supports an in-place operation, may modify the existing object rather than create a replacement. Otherwise, normal binary-operation behavior may apply. This distinction can matter for complex targets or mutable objects, so the two forms should not be treated as universally identical.
Quick Recap
Best Value
Rank #2
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




