0

What is the difference between x=legs; and legs=x; if there's any?

https://code.sololearn.com/c17bI3l4Rb27/?ref=app Instead of legs=x; I wrote x=legs; but I noticed that the output in this case is 0.I am wondering why this happen.

30th Apr 2019, 10:55 AM
Rafael Barbeta
2 Answers
+ 4
The first one assigns legs value to x, the second one assigns x value to legs
30th Apr 2019, 10:57 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 1
Makes sense, thank you!
30th Apr 2019, 11:01 AM
Rafael Barbeta