I have a small problem with my Python 2 program.
Here is my function:
def union(q,p):
q = q + p
q = set(q)
return q, p
Then I have created new two lists and called my function:
a = [1,2,3]
b = [2,4,6]
union(a,b)
Finally I'm printing out a
and b
:
>>>print a
[1,2,3]
>>>print b
[2,4,6]
As you can see my function didn't change the value of a
. Why? How can I fix that? What am I doing wrong?
NOTE: a
used to be [1,2,3,4,6]
instead of [1,2,3]
Thanks.