You get that error because you end up calling the function in your code.
When the function is called,
square(k) returns an
int which is not callable.
Refer to the documentation.
Also, as unutbu has pointed out in the comments to the question, you are
doing an XOR and not computing the square. Squares are computed this way:
x**2 and not
Also, you are returning the result before adding it to the list, so you
might want to reverse the order of the two lines in your function
definition if you want to add the square of the number to the list,