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
En esta página del sitio puede ver el video en línea Swap two integer variable using temp variable | without using team variable | Python Tutorial de Duración hora minuto segunda en buena calidad , que subió el usuario AI & Data Innovation 15 septiembre 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 35 veces y le gustó 4 a los espectadores. Disfruta viendo!