0
can any one explain output of this code
list1=[1, 3,4,5] list2=list1 list2[0]=5 print(list1[0])
4 odpowiedzi
+ 4
The output must be 5 because here the reference of list1 is assigned to list2. So there is a single list pointed by two objects. So the change in one means it will be reflected on the other as well.
+ 1
Not equal - they are the same list.
Just like your mom is also your grandmother's daughter.
Two words, one thing.
0
ouput is 5