Skip to content
Home » Python Programs » Python Program to Find the Length of a List

Python Program to Find the Length of a List

Simple python program to find the length of a list. In this program, we can find the length of a list in python programming language for beginners.

Length Function in Python

The length of a list, string, dictionary, or any other iterable data format in Python is returned by the len() Python method. The len() method in Python is a built-in function for calculating the length of any iterable object. Here we can calculate length() to execute python program to find the length of a list 

List Definition in Python

In Python, a list is an ordered sequence of mutable elements that can be changed. An item is the name given to each element or value found within a list. Lists are defined by values enclosed in square brackets [] in the same way that strings are defined by characters enclosed in quotes.

Python Program to Find the Length of a List

list = [ 10, 40, 50, 76, 83 ]
print ("List is" + str(list))
counter = 0
for i in list:
	counter = counter + 1
print ("Length of List " + str(counter))

Output:

List is[10, 40, 50, 76, 83]
Length of List 5