diff --git a/Swap of two numbers b/Swap of two numbers new file mode 100644 index 0000000..22a78b5 --- /dev/null +++ b/Swap of two numbers @@ -0,0 +1,16 @@ +# Python program to swap two variables + +x = 5 +y = 10 + +# To take inputs from the user +#x = input('Enter value of x: ') +#y = input('Enter value of y: ') + +# create a temporary variable and swap the values +temp = x +x = y +y = temp + +print('The value of x after swapping: {}'.format(x)) +print('The value of y after swapping: {}'.format(y))