1list_a = ["Hello", 2, 15, "World", 34]
2
3number_of_elements = len(list_a)
4
5print("Number of elements in the list: ", number_of_elements)
6
1def length(items):
2 how_many = 0
3 for i in items:
4 how_many += 1
5 return how_many
6a = [8,59,69,49,78,4,7]
7print(length(a))
1list1 = [2,3,4,3,10,3,5,6,3]
2elm_count = list1.count(3)
3print('The count of element: 3 is ', elm_count)
1List = ["Elephant", "Snake", "Penguin"]
2
3print(len(List))
4
5# With the 'len' function Python counts the amount of elements
6# in a list (The length of the list).
7# In this case the output is '3' because there are 3 elements in the list.