I am a beginner, learning python language.I was given a problem of swapping 2 variables without using a third variable. Didn't understand why these variables simply swapped when assigned in this way seperated by a comma
I have googled the reason why this happens but have not come across a detailed satisfactory answer.
a=12 b="Stirling"
print("value of a and b is :\n",a,b)
a,b=b,a
print("After swap value of a and b is :\n",a,b)
I expected an error But output is the 2 variables are simply swapped.