def get_currency_by_type(curr, curr_type):
    for elem in curr:
        val, val_type = elem['currency'].split(',')
if val_type == curr_type and float(val) > 0:
    yield float(val)
python 3.4 list comprehension - calling a temp variable within list