

def somadora():
    qt_parcelas = 0
    total = 0
    try:
        while True:
            parcela = (yield)
            qt_parcelas += 1
            total += parcela
            print(('parcelas: %d  total: %d' % (qt_parcelas, total)))
    finally:
        print(('parcelas: %d  total: %d  media: %d' % (parcela, total, (total / qt_parcelas))))

dataset/ETHPy150Open fluentpython/example-code/attic/control/adder/soma.py somadora/VarMisuse@65/114 `qt_parcelas`->`parcela`