Make 2 sets out of sequences : Set : Data Structure PYTHON examples


PYTHON examples » Data Structure » Set »

 

Make 2 sets out of sequences


 

X = set('spam') 
Y = set(['h''a''m'])                      # Make sets out of sequences
print X, Y 
print X & Y                                   # Intersection
print X | Y                                   # Union
print X - Y                                   # Difference

   
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Data Structure
» Set