From 79f273c5af9ea3e1372a9b79ff4b4ce8ae83b35e Mon Sep 17 00:00:00 2001 From: PRAJESH <47695045+Prajesh-Srivastava@users.noreply.github.com> Date: Fri, 9 Oct 2020 10:52:06 +0530 Subject: [PATCH] Create Swap of two numbers --- Swap of two numbers | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Swap of two numbers 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))