Examveda

Is the following Python 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}

Answer: Option B


This Question Belongs to Python Program >> Sets In Python

Join The Discussion

Related Questions on Sets in Python