What Will Be The Output Of The Following Python Codep Pre #367
What will be the output of the following Python code?</p> <pre><code class="language-python"> >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2) </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 Lists - Python Lists - Quiz No.3.
What will be the output of the following Python code?
>>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2)
[1, 3]
[4, 3]
[1, 4]
[1, 3, 4]