Engaged Employer
Write a program to swap two numbers using python? Since I mentioned before that my favorite programming language is python so the interviewer asked me to solve the coding question using python language.
Anonymous
# Swap two variables in Python a=int(input(“Enter value : “)) b=int(input(“Enter value : “)) print(“Before swapping a :”,a) print(“Before swapping b :”,b) #logic to swap using third variable temp=a a=b b=temp print(“After swapping a becomes :”,a) print(“After swapping b becomes :”,b)
Check out your Company Bowl for anonymous work chats.