Compute A B and output the resulting set. Note that according to the definition of a set,
Fantastic news! We've Found the answer you've been seeking!
Question:
Compute AB and output the resulting set.
Note that according to the definition of a set, the order of the elements does not matter. In this code, the elements of a set are printed in sorted order so that your output will match the expected output in the test cases. Initialize sets A and B
A abcdef
B cdfhjk
printA sortedA
printB sortedB
print
AsymdiffB set
# put your code here to compute the symmetric difference of A and B
# first add all the elements that are in A but not B
# then add all the elements that are in B but not A
printSymmetric Difference of A and B sortedAsymdiffB
Related Book For
Posted Date: