swap numbers without taking third variable in Python

 Question:- 

How can we write a program to swap two numbers without using a third variable in Python?

swap numbers without taking third variable in Python


swaping is very simple in python in comparison to others language.

Let’s see directly it’s an example of it because it will clear everything after program.

Example :-

  1. x, y= 10, 12 
  2. x, y= y, x 
  3. print(x,y)

Comments

Popular posts from this blog

Proassignmenthelp index 27

HackerRank Question: Print Function

Programmingshark index 18