CBSE Class 11 Computer Science Question 84 of 104

List Manipulation — Question 20

Back to all questions
20
Question

Question 18

Consider the following code and predict the result of the following statements.

bieber = ['om', 'nom', 'nom']
counts = [1, 2, 3]
nums = counts
nums.append(4)
  1. counts is nums
  2. counts is add([1, 2], [3, 4])

Answer

  1. Output is True as both nums and counts refer to the same list.
  2. This will cause an error as add function is not defined in the above code.
Answer