I tried this but it gave me this error: SyntaxError: illegal expression for augmented assignment
.
The input will be something like this: -2 4 -1
x_forces, y_forces, z_forces = 0
x_forces, y_forces, z_forces += map(int, input().split(' '))
I tried this but it gave me this error: SyntaxError: illegal expression for augmented assignment
.
The input will be something like this: -2 4 -1
x_forces, y_forces, z_forces = 0
x_forces, y_forces, z_forces += map(int, input().split(' '))
Is this what you're looking for?
x_forces, y_forces, z_forces = 0, 0, 0
n = [i for i in map(int, input().split(' '))]
x_forces += n[0]
y_forces += n[1]
z_forces += n[2]
print(x_forces, y_forces, z_forces)