Collection
{} can represent a collection, {"As", "SST"} is a set set, and there are no duplicate elements in the collection.
#add () adding elements to the collection girls = {' MF ', ' sl ', ' YJ '}girls.add (' XF ')
#pop () randomly deletes an element in the collection boys = {' BD ', ' ZW ', ' JL ', ' zy '}result = Boys.pop ()
#remove () Delete the specified element in the collection removes the element that does not exist boys = {' BD ', ' ZW ', ' JL ', ' Zy '}boys.remove (' Zy ')
#discard () Delete the specified element in the collection removes the element that does not exist boys = {' BD ', ' ZW ', ' JL ', ' Zy '}boys.discard (' zy1 ')
#clear () emptying collection boys = {' BD ', ' ZW ', ' JL ', ' Zy '}boys.clear ()
#copy () Copy Collection boys = {' BD ', ' ZW ', ' JL ', ' zy '}newboys = Boys.copy ()
#Difference () calculates the difference set of 2 sets dreamers = {‘ljl ", ' wc", ' xy" zb ", ' lsy ' }girls = { ' MMF ", ' lsy", ' syj "}result = Dreamers.difference (girls)
#Union () and set operation
# Update() and set updates (same as Union action)
#intersection () calculates the intersection of 2 sets
#Issuperset () detects if the current collection is a superset of another collection
#Issubset () detects if the current collection is a subset of another collection
#Isdisjoint () detects that there is no intersection of 2 sets if there is an intersection False
The ord () function is the Chr () function (for 8-bit ASCII strings) or the UNICHR () function (for Unicode objects), which returns the corresponding ASCII value as an argument with a character (a string of length 1), or Unicode value,
bin () Returns a binary representation of an integer int or long int.
Python can perform bitwise operations directly, A & B, a|b,a^b (OR), ~ (negation),<<,>>
Python Learning Notes