Python Tutorial - How to swap two numbers in PYTHON

Published: 27 September 2017
on channel: Appanna Damu
75
3

How to swap two numbers in PYTHON

#Hi everyone, In this video am going to explain how to swap two numbers
lets start the code,
lets read the two values from keyboard,
now take one temporary variable called temp
and apply swap technique
now use print statement to display output
now run the code
now we can observe the swapping of given numbers a is replaced with 20 and b is replaced with 10
Thanks for watching this video




a=int (input('enter first number '))
b= int (input('enter second number'))
temp=a
a=b
b=temp
print ('a=',a,' , ','b=',b)


On this page of the site you can watch the video online Python Tutorial - How to swap two numbers in PYTHON with a duration of hours minute second in good quality, which was uploaded by the user Appanna Damu 27 September 2017, share the link with friends and acquaintances, this video has already been watched 75 times on youtube and it was liked by 3 viewers. Enjoy your viewing!