Home >>Python Programs >Python program to print the number of elements in an array
In this example, we will see a Python program through which we can count and print the number of elements present in a given array.
The number of elements present in the array can be found by calculating the length of the given array.
#Initialize array
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
#Number of elements present in an array can be found using len()
print("Number of elements present in given array: " + str(len(arr)));