Write an assignment statement that swaps the values of variables X and Y.
code in python
ANSWER:
The assignment statement tthat swaps the value of variables X and Y is:
X, Y = Y, X
OR
Y, X = X, Y
Any of the above two statements can be used to perform the task.
I have provided a code screenshot below to understand how the above statement can be implemented in the code.
Sample code with output screenshot--
Note--
Please up vote if you like the effort
Get Answers For Free
Most questions answered within 1 hours.