CBSE Class 11 Computer Science
Question 75 of 98
Python Programming Fundamentals — Question 37
Back to all questions20 81
x = 40
y = x + 1xis initialized to 40.yis set tox + 1, which means y = 40 + 1 = 41.
x, y = 20, y + xThe values of x and y are updated simultaneously. This means both assignments are evaluated first and then applied.
- The left-hand side of the assignment is
x, y. - The right-hand side is
20, y + x. xis set to 20.yis set toy + x, which means y = 41 + 40 = 81.
print(x, y)The final values of the variables are:
- x = 20
- y = 81
Hence, the output of the program is:
20 81