Python length of list

Python List is a collection of elements. The length of the List can vary. To check the length of the list len() function is used in Python.

Basic Syntax

Following is the basic syntax for abs() function in Java:

int len(list)

And the parameters are:

ParameterDescription
listThe list whose length will be counted

Return Value

Python len() function returns count of elements in given list.

Examples

Following are the examples for len() function in Python.

Example 1

The output should be:

Length of list is: 7

Following are the examples for len() function in Python.

Example 1

The output should be:

Length of list is: 3

LEAVE A REPLY

Please enter your comment!
Please enter your name here