Created
February 25, 2022 09:51
-
-
Save shivam-gupta007/c49237ddb3023ef7939a9db1b49fc00d to your computer and use it in GitHub Desktop.
Python-assignment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num1 = int(input("Enter num1: ")) | |
num2 = int(input("Enter num2: ")) | |
print("Before swapping: ") | |
print("num1: ",num1," num2: ",num2) | |
temp = num1 | |
num1 = num2 | |
num2 = temp | |
print("After swapping: ") | |
print("num1: ",num1," num2: ",num2) | |
# Output - | |
# Enter num1: 10 | |
# Enter num2: 20 | |
# Before swapping: | |
# num1: 10 num2: 20 | |
# After swapping: | |
# num1: 20 num2: 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment