I have a list of dictionaries like:
list = [{'name':'Mike', 'sex':'m'}, {'name':'Rose', 'sex':'f'}]
And I need to count how many dictionaries with sex = f
are in the list. I've tried something like:
count = (p['sex'] == 'f' for p in list)
but count returns as <generator object <genexpr> at 0x1068831e0>
which I don't know what is.