def exactly_n(l, n=1):
 i = iter(l)
 return (all((any(i) for j in range(n))) and (not any(i)))

def exactly_n ( l , n = 1 ) : i = iter ( l ) return ( all ( ( any ( i ) for j in range ( n ) ) ) and ( not any ( i ) ) )
tests that exactly n items in an iterable are "truthy" .