count number of numbers out of order in array python code example Example: count occurrences of value in array python >>> l = ["a","b","b"] >>> l.count("a")