【发布时间】:2019-03-11 06:08:24
【问题描述】:
请帮忙。
>>> a = [7, 2, 2, 2, 3, 2]
>>> b = [2, 2, 2, 3, 3, 5]
Expected result: [2, 7, 3, 5]
有关“图片展示”,请参阅 https://www.w3resource.com/python-exercises/python-basic-exercise-32.php
不允许设置。 不允许收藏。 因为我正在尝试学习循环。
我尝试过与 Intersection of two lists including duplicates? 因为该线程试图做与我试图实现的相反的事情。
还请注意,此问题与以下问题不同: Python removing items from a list that exist in another list but keeping duplicates that aren't in that intersect 也不 Python intersection of two lists keeping duplicates 也不 Python: intersection of 2 lists keeping duplicates from both lists
非常感谢。
【问题讨论】:
标签: python-3.x