Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 66c916a

Browse files
authored
Merge pull request #1 from ravi10393/ravi10393-patch-1
Create Swapping two numbers
2 parents 99cf7d7 + 21917b3 commit 66c916a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Swapping two numbers

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Python code to swap two numbers
2+
# without using another variable
3+
4+
5+
x = 5
6+
y = 7
7+
8+
print ("Before swapping: ")
9+
print("Value of x : ", x, " and y : ", y)
10+
11+
# code to swap 'x' and 'y'
12+
x, y = y, x
13+
14+
print ("After swapping: ")
15+
print("Value of x : ", x, " and y : ", y)

0 commit comments

Comments
 (0)