Skip to content

Instantly share code, notes, and snippets.

@shivam-gupta007
Created February 25, 2022 09:51
Show Gist options
  • Save shivam-gupta007/c49237ddb3023ef7939a9db1b49fc00d to your computer and use it in GitHub Desktop.
Save shivam-gupta007/c49237ddb3023ef7939a9db1b49fc00d to your computer and use it in GitHub Desktop.
Python-assignment
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