Symmetric difference: Difference between revisions
Added 11l
Alextretyak (talk | contribs) (Added 11l) |
|||
Line 20:
# In the mathematical notation above <code>A \ B</code> gives the set of items in A that are not in B; <code>A ∪ B</code> gives the set of items in both A and B, (their ''union''); and <code>A ∩ B</code> gives the set of items that are in both A and B (their ''intersection'').
<br><br>
=={{header|11l}}==
{{trans|Python}}
<lang 11l>V setA = Set([‘John’, ‘Bob’, ‘Mary’, ‘Serena’])
V setB = Set([‘Jim’, ‘Mary’, ‘John’, ‘Bob’])
print(setA.symmetric_difference(setB))
print(setA - setB)
print(setB - setA)</lang>
{{out}}
<pre>
Set([Jim, Serena])
Set([Serena])
Set([Jim])
</pre>
=={{header|Ada}}==
|