What is a set difference operation in Python

Set Difference

The difference method finds the difference between two sets.


a = set([1, 2, 3]) 
b = set([2, 3, 4]) 
print a.difference(b) 
print a




















Home »
  Python »
    Data Types »




Data Types
String
String Format
Tuple
List
Set
Dictionary