Informatics Practices
Consider the following statement:
List = ['h', 'o', 'i']
The length of the above list is:
- 5
- 3
- 0
- None of these
Python List Manipulation
1 Like
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.
Answered By
2 Likes
Related Questions
index() function will return the index of first matched item from the list.
extend() function is used to add multiple list items in a list.
The list L1 contains [3, 4, 5, 6, 6, 8, 0]. What will be the output of the following expression?
print(L1 [-1])- 0
- 3
- 5
- 8
Which of the following statements is correct about list?
- List can contain values of mixed data types.
- List can contain duplicate values.
- A list with no elements is called an empty list.
- All of these