How to swap the values of two integer variables?
#python #programming #pythonprograms #pythonprogramming #pythontutorialsforbeginners #interview #fresherinterview
Solution:
1. Using temp variable
num1=10
num2=20
temp=num1
num1=num2
num2=temp
2. Without temp variable by arithmetic operation
num1=10
num2=20
num1=num1+num2 #num1=30
num2=num1-num2 #num2=30-20
num1=num1-num2 #num2=30-10
print("num1=" + str(num1) + "\n" + "num2=" + str(num2))
My profile : https://www.dot-net-tutorials.com/p/i...
My Linkedin Profile: / mdafazal
On this page of the site you can watch the video online Swap two integer variable using temp variable | without using team variable | Python Tutorial with a duration of hours minute second in good quality, which was uploaded by the user AI & Data Innovation 15 September 2024, share the link with friends and acquaintances, this video has already been watched 35 times on youtube and it was liked by 4 viewers. Enjoy your viewing!