Question: I have a list of integers and I need to count how many of them are > 0.  

I'm currently doing it with a list comprehension that looks like this:

```
sum([1 for x in frequencies if x > 0])

```

It seems like a decent comprehension but I don't really like the "1"; it seems like a bit of a magic number. Is there a more Pythonish way to do this?

Answer: 
A slightly more Pythonic way would be to use a generator instead:

```
sum(1 for x in frequencies if x > 0)

```

This avoids generating the whole list before calling `sum()`.
How about this?

`reduce(lambda x, y: x+1 if y > 0 else x, frequencies)`

EDIT:
With inspiration from the accepted answer from @~unutbu:

`reduce(lambda x, y: x + (y > 0), frequencies)`