Question: # Initialize sets A and B A = { ' a ' , ' b ' , ' c ' , ' d ' ,
# Initialize sets A and B
A abcdef
B cdfhjk
printA sortedA
printB sortedB
print
#Block : computes and prints out the set A B
AminusB set
for element in A: # this line runs through every element in A
if notelement in B: #A B is the set of elements that are in A and are not in B
AminusB.addelement # Add it AminusB every element in A if the element is also not in B
printA B sortedAminusB
print
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
