logo
Python Data Structures - Interview Questions and Answers
How do you find the length of a list in Python?

You can find the length of a list in Python using the built-in len() function.

Example :
my_list = [10, 20, 30, 40, 50]
length = len(my_list)
print(length)  # Output: 5

* len() is the most efficient way to get the number of elements in a list.