I am wondering if this is possible somehow. I would like to increase both values once that I unpack it, without having to create two temps variables. Is this somehow possible with multiple assignment and unpacking? I started to try out here:
a, b = 1, 1
for i in [1,2,3]:
a, b += 1, 1
File "<ipython-input-2-a1e761cf8ae1>", line 2
a, b += 1, 1
^
SyntaxError: illegal expression for augmented assignment
for i in [1,2,3]:
a, b += (1, 1)
File "<ipython-input-3-9317a6e51de4>", line 2
a, b += (1, 1)
^
SyntaxError: illegal expression for augmented assignment
for i in [1,2,3]:
(a, b) += (1, 1)
File "<ipython-input-4-446db199ce6f>", line 2
(a, b) += (1, 1)
^
SyntaxError: illegal expression for augmented assignment
for i in [1,2,3]:
a += 1