问题是在不使用相应方法的情况下找到两组之间的对称差异!
来自 future import print_function
M=int(raw_input())
X=map(int,raw_input().split())
N=int(raw_input())
Y=map(int,raw_input().split())
mys=set()
mys1=set()
for i in X:
mys.add(i)
for i in Y:
mys1.add(i)
un=mys.union(mys1)
inx=mys.intersection(mys1)
sd=un.difference(inx)
w=list(sd)
w=w.sort()
for i in (w):
print(w[i],end=' ')
发生错误:
Traceback (most recent call last): File "hackset.py", line 18, in
<module>
for i in len(w): TypeError: object of type 'NoneType' has no len()**