adplus-dvertising
frame-decoration

Question

Is the following piece of code valid?
>>> a=frozenset([5,6,7])
>>> a
>>> a.add(5)

a.

Yes, now a is {5,5,6,7}

b.

No, frozen set is immutable

c.

No, invalid syntax for add method

d.

Yes, now a is {5,6,7}

Posted under Tuples and Sets Python

Answer: (b).No, frozen set is immutable

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Is the following piece of code valid?