#NEWLINE# def count( self , func ) : #NEWLINE# #INDENT# '\n        Counts the number of elements in the sequence which satisfy the predicate func.\n\n        >>> seq([-1, -2, 1, 2]).count(lambda x: x > 0)\n        2\n\n        :param func: predicate to count elements on\n        :return: count of elements that satisfy predicate\n        ' #NEWLINE# n = 0 #NEWLINE# for element in self : #NEWLINE# #INDENT# if func ( func ) : #NEWLINE# #INDENT# n += 1 #NEWLINE# #UNINDENT# #UNINDENT# return n