Project Euler #2: Even Fibonacci numbers

  • + 0 comments

    Easiest Solution with all test cases passing. t = int(input().strip()) for a0 in range(t): n = int(input().strip()) t1=1 t2=2 temp=2 t3=0 while(True): t3=t1+t2 t1,t2=t2,t3 if(t3>n): break if(t3%2==0): temp+=t3 print(temp)