Informatics Practices
Answer
8 5
Working
x = 3
y = x + 2
xis initialized to 3.yis set tox + 2, which means y = 3 + 2 = 5.
x += y
The += operator adds the value of y to x and assigns the result back to x.
- Current values are:
- x = 3
- y = 5
- Calculation: x + y = 3 + 5 = 8
- Updating
x: x += 5 means x = x + 5 - So, x = 3 + 5 = 8.
print(x, y)
The final values of the variables are:
- x = 8
- y = 5
Hence, the output of the program is:
8 5