Euler problems 2 and 7 in Python