fespino
5/8/2015 - 7:41 PM

Python Tips & Tricks

# Python Tips and Tricks

## Set union and intersection

```python
>>> set("abcd") & set("cdef")
set(['c', 'd'])
>>> set("abcd") | set("cdef")
set(['a', 'c', 'b', 'e', 'd', 'f'])
```