count number of specific elements in array python code example
Example 1: how to find the number of times a number appears in python
dict((i, a.count(i)) for i in a)
Example 2: python how to count items in array
myArray = [1, 2, 3]
len(myArray)
#output
3