Is it possible to do multiple variable increments on the same line in Python?
Example:
value1, value2, value3 = 0
value4 = 100
value1, value2, value3 += value4
In my real program I have LOTS of variables that are different but must all be added on with a single variable at one point.
What I am currently doing that I wanted this to replace:
value1 += value4
value2 += value4
value3 += value4
...
value25 += value4
value1, value2, value3 = (v + value4 for v in (value1, value2, value3))
... – Moina