things like strings and lists to sets to run this test'ein true membership (sets'ein 'camelot' in [ (truetruebut works on other types too in addition to expressionsthe set object provides methods that correspond to these operations and moreand that support set changes--the set add method inserts one itemupdate is an in-place unionand remove deletes an item by value (run dir call on any set instance or the set type name to see all the available methodsassuming and are still as they were in the prior interactionz intersection(yz set([' '' '] add('spam' set([' '' ''spam'] update(set([' '' ']) set([' '' '' '' ''spam'] remove(' ' set([' '' '' ''spam']same as insert one item mergein-place union delete one item as iterable containerssets can also be used in operations such as lenfor loopsand list comprehensions because they are unorderedthoughthey don' support sequence operations like indexing and slicingfor item in set('abc')print(item aaa ccc bbb finallyalthough the set expressions shown earlier generally require two setstheir method-based counterparts can often work with any iterable type as wells set([ ] set([ ]expressions require both to be sets set([ ] [ typeerrorunsupported operand type(sfor |'setand 'lists union([ ]but their methods allow any iterable set([ ] intersection(( )set([ ] issubset(range(- )true other numeric types