I have been trying to write a program that swaps two values only using tuples. It must have two float values and only use two variables. I solved it using a math equation but need to find one more way to program it.
The math equation I have for swapping the values works, but I need to find another way without swapping the values using math.
x = float(input("Please enter a value for x: "))
y = float(input("Please enter a value for y: "))
x = x+y
y = x-y
x = x-y
print ("x is: ", x)
print ("y is: ", y)
Ideally I would be able to swap the values without adding and subtracting the values from each other.