#!/usr/bin/env python

def fib_sum(ub):
    a = 1
    b = 2
    
    num = [b]
    next = 0
    while (next < ub):
        next = a + b
        a = b
        b = next
        if (next < ub and next % 2 == 0):
            num.append(next)

    return num

print sum(fib_sum(4 * 1000 * 1000))

168a6e198d74765b1916f3af6be1ee0ffafb6378
#!/usr/bin/env python

def fib_sum(ub):
    a = 1
    b = 2
    
    num = [b]
    next = 0
    while (next < ub):
        next = a + b
        a = b
        b = next
        if (next < ub and next % 2 == 0):
            num.append(next)

    return num

print sum(fib_sum(4 * 1000 * 1000))
