Skip to content
TechDecode Tutorials

TechDecode Tutorials

Short and Simple Tech Tutorials

  • C++
    • C++ Programs
    • C++ Tutorials
    • C++ Course
    • C Programs
    • C Tutorials
  • Java
    • Java Notes
    • Programs
    • Tutorials
    • Java Courses
  • Python
    • Python Notes
    • Programs
    • Tutorials
    • Python Course
  • c#
    • C# Courses
  • Web Development
    • HTML
    • CSS
    • Javascript
      • Javascript Program
      • JavaScript Course
    • PHP
  • Data Science
    • R Programming
    • Data Science Courses
  • Application
  • Download
  • Tech
    • Cyber Security
    • Cyber Security Courses
Python Notes Python Programs 

How to swap two numbers using python code

June 30, 2022June 30, 2022 admin swap two numbers python

In this tutorial, we are going to show How to Swap two numbers using python without using a third variable. We have added the video tutorial and the source code of the program.

Video Tutorial: Swap two numbers using python code

Source Code

# Python program to swap two numbers

a = input('Enter value of a: ')
b = input('Enter value of b: ')

print('\nOriginal Values \n a=',a,'\n b=',b)

a,b = b,a 

print('\nAfter Swapping\n a=',a,'\n b=',b)

Output

Also Read: Python program to create bmi calculator

  • ← Simple JavaScript Games For Beginners
  • What is automated data mining in python and what are its benefits? →

You May Also Like

Python – For Loop

May 27, 2022 Nihal Prasad
print LCM of Two Integers in Python

Print LCM of Two Integers in Python

October 10, 2021October 10, 2021 Ethix

Draw france flag using python turtle

April 16, 2022April 16, 2022 admin

Python

  • Python - Introduction
  • Python - Syntax
  • Python - Comments
  • Python - Variables
  • Python - Data Types
  • Python - Numbers
  • Python - Type Casting
  • Python - Operators
  • Python - Booleans
  • Python - Strings
  • Python - Lists
  • Python - Tuples
  • Python - Sets
  • Python - Dictionary
  • Python - If Else
  • Python - While Loop
  • Python - For Loop
  • Python - Continue Statement
  • Python - Break Statement
  • Python - Functions
  • Python - Lamda Function
  • Python - Scope of Variables
  • Python - Modules
  • Python - Iterators

About Us

logo
Our mission is to deliver technical tutorials with clear, crisp, and to-the-point content on a wide range of subjects without any preconditions and impediments.

Company

  • About Us
  • Internship
  • Contact Us
  • Privacy Policy
  • Copyright Policy

Learn

  • C++
  • Java
  • Python
  • R Programming
  • Web Development

Powered By

Copyright © 2025 TechDecode Tutorials. All rights reserved.
Theme: ColorMag by ThemeGrill. Powered by WordPress.