x = 10
y = 11
print(f'Before swapping x is {x} and y is {y}.')
x = x + y # 21
y = x - y # 10
x = x - y # 11
print(f'After swapping x is {x} and y is {y}.')
Study more about Python at Python Class 10
Ask the community — students and mentors are here to help, and you can search past answers too.
Ask a Question arrow_forward