adplus-dvertising
frame-decoration

Question

What is the output of the code shown below?
s=set([1, 2, 3])
s.union([4, 5])
s|([4, 5])

a.

{1, 2, 3, 4, 5}
{1, 2, 3, 4, 5}

b.

Error
{1, 2, 3, 4, 5}

c.

{1, 2, 3, 4, 5}
Error

d.

Error
Error

Posted under Tuples and Sets Python

Answer: (c).{1, 2, 3, 4, 5}
Error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the code shown below?