From 80697789bbef0f3d5c72aedd96e5de1088c4f861 Mon Sep 17 00:00:00 2001 From: avi-ux <66065976+avi-ux@users.noreply.github.com> Date: Sat, 3 Oct 2020 11:31:52 +0530 Subject: [PATCH] Update swaping of variables i just performed a small changes in your code i just use simple method for swaping variable i you like please merge it and accept pull request.. --- swaping of variables | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/swaping of variables b/swaping of variables index 22a78b5..24821de 100644 --- a/swaping of variables +++ b/swaping of variables @@ -7,10 +7,13 @@ y = 10 #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 +# used a simple trick to swaping variable + +#temp = x +#x = y +#y = temp + +x,y=y,x print('The value of x after swapping: {}'.format(x)) print('The value of y after swapping: {}'.format(y))