Swapping Two Values Without Extra Variable
First Solve It
Solution Code :
# without temp variable
i = int(input('i : '))
j = int(input('j : '))
i, j = j, i
print(i, j)
Second Logic
Solution Code:
x = 100
y = 200
print('x =', x)
print('y =', y)
x = x + y
y = x - y
x = x - y
print('after swapping ....')
print('x = ', x)
print('y = ', y)
Write Your Logic In Comment Box