python learning diary - a collection of functions

set

Collection (set) is an unordered sequence of elements will not be repeated. When you add weight to automatically repeat elements.

Can use braces  {}, or  set () function creates a set of note: Create an empty set must be  set () instead of  {}, because  {} is used to create an empty dictionary.

Support in and not in operations

Calculating the difference 
a - b 
on the intersection 
a & b 
taken and set 
a | b   
are not simultaneously included in the a and b elements of 
a ^ b

  

Guess you like

Origin www.cnblogs.com/ftxy/p/11708050.html