Skip to content

Instantly share code, notes, and snippets.

@yuda110
Last active April 22, 2016 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuda110/1d80edf334b432a6b42f62d72ac28cea to your computer and use it in GitHub Desktop.
Save yuda110/1d80edf334b432a6b42f62d72ac28cea to your computer and use it in GitHub Desktop.
#python3
num1 = 0
num2 = 1
num3 = num1 + num2
result = 0
while num3 <= 4000000 :
num3 = num1 + num2
num1 = num2
num2 = num3
if num3 % 2 == 0 :
result += num3
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment