【发布时间】:2016-12-26 09:56:09
【问题描述】:
I want this output in list3我有两个具有自定义数据类型的list
list1 = {A, B, C, D}
[enter image description here][1]
list2 ={ X, A, B, Y}
然后我需要从list1 中删除A、B,并使用list1 从list2 添加A 和B。
list3 = { A(list2), B(list2), C(list1), D(list1)}
See Above Image, I want those items whose ts_key = 0 and if those records are already in list then get ts_key <> 0 for repeated record
【问题讨论】:
-
您的元素 A、B、C、D 的数据类型是什么?
-
你尝试了什么?
-
用英文解释条件,然后用代码写就很简单了。 为什么 A 和 B 应该取自 list2 而不是 list1?您是否还需要从 list1 和 list2 中删除项目,或者您只是想要一个新集合? list1 的 A 和 list2 的 A 有什么区别?为什么要选后者?
-
@Sefe 我尝试相交,但它不起作用