I have two lists in Python, like these:
(我在Python中有两个列表,如下所示:)
temp1 = ['One', 'Two', 'Three', 'Four']
temp2 = ['One', 'Two']
I need to create a third list with items from the first list which aren't present in the second one.
(我需要用第一个列表中的项目创建第二个列表,而第二个列表中没有这些项目。)
From the example I have to get: (从示例中,我必须得到:)
temp3 = ['Three', 'Four']
Are there any fast ways without cycles and checking?
(有没有循环和检查的快速方法吗?)
ask by Max Frai translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…