Skip to content

Commit 3e398b2

Browse files
swap two variables
1 parent 744cae6 commit 3e398b2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Programs/SwapTwoVariables.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ============= Solution 01 =============
2+
# x = 5
3+
# y = 7
4+
# temp = x
5+
# x = y
6+
# y = temp
7+
# print("x is ", x, "y is ", y)
8+
9+
# ============= Solution 02 =============
10+
x = 5
11+
y = 7
12+
x,y =y ,x
13+
14+
print("x is ", x, "y is ", y)

0 commit comments

Comments
 (0)