Is The Following Python Code Validp Pre Langpython #485
Is the following Python code valid?</p> <pre><code class="language-python"> >>> a=(1,2,3) >>> b=a.update(4,) </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 Tuples - Python Tuples - Quiz No.3.
Is the following Python code valid?
>>> a=(1,2,3) >>> b=a.update(4,)
Yes, a=(1,2,3,4) and b=(1,2,3,4)
Yes, a=(1,2,3) and b=(1,2,3,4)
No because tuples are immutable
No because wrong syntax for update() method