Question
What is the output of the code shown below?
s=set([1, 2, 3])s.union([4, 5])s|([4, 5])
s=set([1, 2, 3])s.union([4, 5])s|([4, 5])
Answer: Option C
Was this answer helpful ?
The first function in the code shown above returns the set {1, 2, 3, 4, 5}. This is because the method of the function union allows any iterable. However the second function results in an error because f unsupported data type, that is list and set.
Was this answer helpful ?
Submit Solution