Basic Programs

If Else Programs

While loop Programs

For loop Programs

List Programs


Python Program to Find the Length of a List.


In this example shows, how to find the length of list . It can be used to find the object within the parentheses.

Example.py
list1 = [10, 20, 30, 40, 50, 60]
n = len(list1)
print("Length of list1 : ", n)

list2 = []
n = len(list2)
print("Length of list2 : ", n)

list3 = [[1, 2], ["BBA", "BCA"], 11.8, [10, 20]]
n = len(list3)
print("Length of list3: ", n)

Output

Length of list1 :  6
Length of list2 :  0
Length of list3:  4

Prev Next