10 points · by danbmil99 · 6y ago · 5 comments
foo=[0];bar=[foo];foo[0]=bar
Extra credit:
1) what is bar[0]
2) foo==bar
It's just a circular data structure, many (or even most) languages give you enough rope to hang yourself with one of those. Nothing particularly surprising or Python-specific about it.
bar[0] = foo
false
if wrong please correct accordingly.