CBSE Class 11 Computer Science Question 21 of 82

Lists in Python — Question 1

Back to all questions
1
Question

Question 1

Consider the following statement:

List = ['h', 'o', 'i']

The length of the above list is:

  1. 5
  2. 3
  3. 0
  4. None of these
Answer

3

Reason — The length of a list in Python is determined by the number of elements it contains. The list ['h', 'o', 'i'] has three elements: 'h', 'o', and 'i'. Therefore, the length of the list is 3.