Set in the python

Programming May 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 :)

Tags

Minseo Chayabanjonglerd

I am a full-time Android Developer and part-time contributor with developer community and web3 world, who believe people have hard skills and soft skills to up-skill to da moon.