Python List Length

  • Post category:List

The len() the method returns the number of items in the list.

In this blog post, you will learn how to calculate python list length.

Step 1: Create a list

my_list = [1, 2, 3, 4, 5]

Step 2: Print the list

len_list = len(my_list)

Step 3: Print the length of the list

print(len_list)

Output:

5