Q:

What will be the output of the following Python code and state the type of copy that is depicted? l1=[2, 4, 6, 8] l2=[1, 2, 3] l1=l2 l2

0

What will be the output of the following Python code and state the type of copy that is depicted? 

l1=[2, 4, 6, 8] l2=[1, 2, 3] l1=l2 l2 The code shown above depicts shallow copy and the output of the code is: [1, 2, 3].

  1. [2, 4, 6, 8], shallow copy
  2. [2, 4, 6, 8], deep copy
  3. [1, 2, 3], shallow copy
  4. [1, 2, 3], deep copy

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Correct Answer:

[1, 2, 3], shallow copy

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now