Skip to content

Commit ed7c7e5

Browse files
Merge pull request seeditsolution#269 from shreeamahadik/patch-2
Create swaping of variables
2 parents 93016ab + a8be630 commit ed7c7e5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

swaping of variables

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Python program to swap two variables
2+
3+
x = 5
4+
y = 10
5+
6+
# To take inputs from the user
7+
#x = input('Enter value of x: ')
8+
#y = input('Enter value of y: ')
9+
10+
# create a temporary variable and swap the values
11+
temp = x
12+
x = y
13+
y = temp
14+
15+
print('The value of x after swapping: {}'.format(x))
16+
print('The value of y after swapping: {}'.format(y))

0 commit comments

Comments
 (0)