What will be the output of the following Python code? >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2)

Questions & AnswersCategory: Programming LanguageWhat will be the output of the following Python code? >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2)
Geek Boy Staff asked 2 years ago

What will be the output of the following Python code?

>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)

a. [1, 4]
b. [1, 3, 4]
c. [4, 3]
d. [1, 3]