Keeps the count of cell having value as 0
black = 0 NEW_LINE for i in range ( 0 , N ) : NEW_LINE INDENT for j in range ( 0 , M ) : NEW_LINE INDENT if ( mat [ i ] [ j ] == 0 ) : NEW_LINE INDENT black += 1 NEW_LINE DEDENT DEDENT DEDENT