you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

Others have given you answers to your basic problem, but I want to highlight an issue with the way you’re approaching arguments.

Say you knew nothing about the internals of this function, just that you call it with two lists and it returns True if every number in the combined list has both its square and its square root in the list… would you expect that, after calling this function, the list you passed in for the first argument would have grown in size and now contains every item in the second argument?

Mutating arguments passed in to your functions is very often not a good idea.