def removeCommonElements(tup1,tup2):
count=0
lis1=list(tup1)
lis2=list(tup2)
while count<=len(lis1):
for i in lis1:
if i in lis2:
lis1.remove(i)
lis2.remove(i)
count+=1
return tuple(lis1+lis2)
print(removeCommonElements((1,2,3,4), (3,4,5,6)))
我需要输出 as(1, 2, 5, 6)
并且我得到输出 as (1, 2, 4, 4, 5, 6)
。我找不到我的错误。谁能帮帮我吗?谢谢