Question: 1. Given the following python code, what is the output set1 = set([A, B, C, D]) set4 = set([A, B]) set3 = set1 - set4
1. Given the following python code, what is the output
set1 = set(["A", "B", "C", "D"])
set4 = set(["A", "B"]) set3 = set1 - set4 print(set3)
a.{'A', 'B', 'C', 'D'} b.{'A', 'B'} c.{'C', 'D'} d.Error generated or none of the above
2.Given the following python code, what is the output
set1 = set(["A", "B", "C", "D"]) set2 = set(["A", "U", "V"]) set3 = set(["M", "N", "O", "P", "Q"]) set4 = set(["A", "B"]) set5 = (set1 & set2) | set4 print(set5)
a.{'A', 'B', 'C', 'D'} b.{'A', 'B'} c.{'C', 'D''} d.Error generated or none of the above
Given the following python code, what is the output
set1 = set(["A", "B", "C", "D"]) set2 = set(["A", "U", "V"]) set3 = set(["M", "N", "O", "P", "Q"]) set4 = set(["A", "B"]) issubset = set1 <= set4 # Subset test print(issubset) issuperset = set1 >= set4 # Superset test print(issuperset)
a.False True b.True False c.False, False d.True True e. Error generated or none of the above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
