How to find the union of two lists in Python - example (lists and sets in Python)

preview_player
Показать описание
Hi everyone.
In this lesson we're going to talk about that how to find the union of two lists in Python.
Рекомендации по теме
Комментарии
Автор

it's wrong in some cases of list,
for example:
a=[2, 2, 3, 4]
b=[2, 3, 5, 5]
a U b supposed to be [2, 2, 3, 4, 5, 5 ]
but when you convert the list into set it will lose the repetitive data
in your method, the result will be a U b = { 2, 3, 4, 5}

aman
Автор

You saved me, Thank you so much T___T

assalahamidani