diff --git a/Python/swap.py b/Python/swap.py new file mode 100644 index 00000000..f14452b9 --- /dev/null +++ b/Python/swap.py @@ -0,0 +1,13 @@ +num1 = input('Enter First Number: ') +num2 = input('Enter Second Number: ') + +print("Value of num1 before swapping: ", num1) +print("Value of num2 before swapping: ", num2) + +# swapping two numbers using temporary variable +temp = num1 +num1 = num2 +num2 = temp + +print("Value of num1 after swapping: ", num1) +print("Value of num2 after swapping: ", num2)