Home / CSE MCQs / Python MCQs :: Discussion

Discussion :: Python MCQs

  1. What is the output of the following code?

    import copy
    a=[10,23,56,[78]]
    b=copy.deepcopy(a)
    a[3][0]=95
    a[1]=34
    print(b)
  2. A.
    [10,34,56,[95]].
    B.
    [10,23,56,[78]].
    C.
    [10,23,56,[95]].
    D.
    [10,34,56,[78]].

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    The above copy is deepcopy. Any change made in the original list isn't reflected.


Be The First To Comment