# Set difference

> Get difference of two sets: Input Output

- Canonical: https://preview.arshadmehmood.com/today-i-learned/python/set-difference/
- Section: python
- Author: Arshad Mehmood

Get difference of two sets:

### Input
```python
set1 = {10, 20, 30, 40, 80}  
set2 = {100, 30, 80, 40, 60} 
  
print("set1 - set2 : ", set1.difference(set2)) 
print("set2 - set1 : ", set2.difference(set1))  

```

### Output
```py
set1 - set2 : {10, 20}
set2 - set1 : {100, 60}
```

