Python Program to Swap Two Numbers



To swap two numbers we will use another temporary variable to store the value of first number.



  1. #Python program to calculate area of a triangle
  2. a= input("Enter first number: ")
  3. b= input("Enter second number: ")
  4. c=a
  5. a=b
  6. b=c
  7. print("Swapping of the numbers are", a, b)

Output
Output!
Please click on the like button if it worked

Solution not working or have any suggestions? Please send an email to [email protected]


Join Our Facebook Group


Share this example


Download Android App





codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube