Simple Assignment Operator become Complicated in Python
问题 I have declared four variables [a=1,b=2,c=3,d=0] in python and swapping them in one line code using ',' and '=' (Simple Assignment Operator). I have got multiple Answers and got confused. please help me... Case 1: a=1 b=2 c=3 d=0 a=a,b=b,c print "a = " + str(a) print "b = " + str(b) print "c = " + str(c) print "d = " + str(d) Output of Case 1: a = 2 b = 3 c = 3 d = 0 Case 2: a=1 b=2 c=3 d=0 b=a,b=b,c print "a = " + str(a) print "b = " + str(b) print "c = " + str(c) print "d = " + str(d)