
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Python Set Methods MethodDescription Add() Adds an element to the set Clear() Removes all the elements from the set Copy() Returns a copy of the set Difference() Returns a set containing the difference between two or more sets Difference_update() Removes the items in this set that are also included in another, specified set Discard() Remove the specified item Intersection() Returns a set, that is the intersection of two other sets Intersection_update() Removes the items in this set that are not present in other, specified set(s) Isdisjoint() Returns whether two sets have a intersection or not Issubset() Returns whether another set contains this set or not Issuperset() Returns whether this set contains another set or not Pop() Removes an element from the set Remove() Removes the specified element Symmetric_difference() Returns a set with the symmetric differences of two sets Symmetric_difference_update() inserts the symmetric differences from this set and another Union() Return a set containing the union of sets Update() Update the set with another set, or any other iterable