Is The Following Python Code Validp Pre Langpython #475
Is the following Python code valid?</p> <pre><code class="language-python"> >>> a=(1,2,3) >>> b=('A','B','C') >>> c=tuple(zip(a,b)) </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.2.
Is the following Python code valid?
>>> a=(1,2,3) >>> b=('A','B','C') >>> c=tuple(zip(a,b))
Yes, c will be ((1, 'A'), (2, 'B'), (3, 'C'))
Yes, c will be ((1,2,3),(‘A’,’B’,’C’))
No because tuples are immutable
No because the syntax for zip function isn’t valid