Ad
  • Custom User Avatar
  • Custom User Avatar

    No, it is actually more confusing than that!

    The first time array.pop(0) is executed the array variable is still bound to the input argument.

    But after that, the array variable is rebound to a new list, and therefore no longer mutates the input argument.

    So, the input array is changed after the function, but only with its first row removed.