0
Can anyone tell me the reason is 2,3,1
2 Respuestas
+ 2
a,b,c=1,2,3
a,b,c=c,a,b=b,a,c=c,b,a
print(a,b,c)
Here, a = 1
b = 2 and c = 3
second line code:
a = c
b = a
c = b
then again,
c = b
a = a
b = c
At last:
b = c # value = 3
a = b # value = 2
c = a # value = 1
print(a, b, c)
value is swaped.
The last all value is taken so.
2, 3, 1
I also wanna see better explanation, my eng is a bit weak can't explain fully.
+ 1
Thx man ★«D.Connect_Zone» so it's chained right