【发布时间】:2014-08-27 01:59:18
【问题描述】:
>>> x1=[["x1","y1"],["x1","x2"]]
>>> x2=[["x1","y1"],["x1","x2"],["x2","y2"]]
>>> x2-x1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'list' and 'list'
>>> set(x2)-set(x1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
我想得到两个列表之间的差异,这里我想要的结果是["x2","y2"]。我怎样才能得到它?
【问题讨论】:
标签: python