Set in the python

Minseo Chayabanjonglerd
MikkiPastel
Published in
1 min readMay 31, 2017

Hello everyone, I have problem about compare 2 list and found solution to solve this with set.

Introduction

union for find all content in list a and b ->set(a) | set(b)
intersection for find same content in list a and b -> set(a) & set(b)
complement for find all content in a but not in b -> set(a) — set(b)
subset for find all content from a in b -> set(a).issubset(set(b))

then should be convert list to set :)

--

--

Minseo Chayabanjonglerd
MikkiPastel

Android Developer | Content Creator AKA. MikkiPastel | Web2 & Web3 Contributor