Skip to content

Commit

Permalink
Create swap two numbers
Browse files Browse the repository at this point in the history
python program for swapping two numbers
  • Loading branch information
famidrafeeque committed Oct 20, 2020
1 parent 303be3e commit 4cefca8
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 4cefca8

Please sign in to comment.