adplus-dvertising
frame-decoration

Question

What is the output for the following piece of code?
>>> a={1,2,3}
>>> b=a
>>> b.remove(3)
>>> a

a.

{1,2,3}

b.

Error, copying of sets isn’t allowed

c.

{1,2}

d.

Error, invalid syntax for remove

Posted under Python

Answer: (c).{1,2}

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 for the following piece of code?