all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
>>> setA = {"John", "Bob", "Mary", "Serena"}
|
||||
>>> setB = {"Jim", "Mary", "John", "Bob"}
|
||||
>>> setA ^ setB # symmetric difference of A and B
|
||||
{'Jim', 'Serena'}
|
||||
>>> setA - setB # elements in A that are not in B
|
||||
{'Serena'}
|
||||
>>> setB - setA # elements in B that are not in A
|
||||
{'Jim'}
|
||||
>>>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
>>> setA = set(["John", "Bob", "Mary", "Serena"])
|
||||
>>> setB = set(["Jim", "Mary", "John", "Bob"])
|
||||
>>> setA ^ setB # symmetric difference of A and B
|
||||
set(['Jim', 'Serena'])
|
||||
>>> setA - setB # elements in A that are not in B
|
||||
set(['Serena'])
|
||||
>>> setB - setA # elements in B that are not in A
|
||||
set(['Jim'])
|
||||
Loading…
Add table
Add a link
Reference in a new issue