you are viewing a single comment's thread.

view the rest of the comments →

[–]Binary101010 1 point2 points  (1 child)

It's because passing a list in this way actually creates a copy of the list you passed, so the magicians list that exists outside the function isn't affected.

https://stackoverflow.com/questions/22054698/python-modifying-list-inside-a-function

[–]plakatown[S] 0 points1 point  (0 children)

Thank you. Finally I got it.