【发布时间】:2022-12-01 22:40:52
【问题描述】:
I have the lista:
a = ['wood', 'stone', 'bricks', 'diamond']
And the listb:
b = ['iron', 'gold', 'stone', 'diamond', 'wood']
I need to compare lists and if value of listaequals with value from listb, it will be added to a listc:
c = ['wood', 'stone', 'diamond']
How can I compare these lists?
【问题讨论】:
-
Does this answer your question? Common elements comparison between 2 lists
-
oh, yeah, thanks, @buran