Reputation: 4752
I often require doding a simple 1 unit incrementation (++) in Python.
I never seem to find a better solution than
x = x + 1
What am I doing wrong ?
Upvotes: 7
Views: 9891
Reputation: 837906
Python doesn't have a ++
operator. You should use the +=
operator:
x += 1
Upvotes: 20