Is The Following Python Code Validp Pre Langpython #504
Is the following Python code valid?</p> <pre><code class="language-python"> >>> a=frozenset([5,6,7]) >>> a >>> a.add(5) </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs109 Python. It can also be found in gs gs109 Python Sets - Python Sets - Quiz No.2.
Is the following Python code valid?
>>> a=frozenset([5,6,7]) >>> a >>> a.add(5)
Yes, now a is {5,5,6,7}
No, frozen set is immutable
No, invalid syntax for add method
Yes, now a is {5,6,7}