Skip to content

Commit

Permalink
Merge pull request tarunsinghofficial#622 from famidrafeeque/patch-1
Browse files Browse the repository at this point in the history
Create swap two numbers
  • Loading branch information
tarunsinghofficial authored Oct 21, 2020
2 parents eeaf8a6 + 4cefca8 commit 28c159f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Python-programming-1/swap two numbers
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
num1 = input('Enter First Number: ')
num2 = input('Enter Second Number: ')

print("Value of num1 before swapping: ", num1)
print("Value of num2 before swapping: ", num2)

# swapping two numbers using temporary variable
temp = num1
num1 = num2
num2 = temp

print("Value of num1 after swapping: ", num1)
print("Value of num2 after swapping: ", num2)

0 comments on commit 28c159f

Please sign in to comment.