Renamed files to keep them ordered

This commit is contained in:
Lauchmelder23 2018-10-10 22:34:34 +02:00
parent 20d1667a93
commit 5ae21a2b02
14 changed files with 0 additions and 0 deletions

26
Problem_002.py Normal file
View file

@ -0,0 +1,26 @@
######################################################################
# Each new term in the Fibonacci sequence is generated by adding the
# previous two terms. By starting with 1 and 2, the first 10 terms will be:
#
# 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
#
# By considering the terms in the Fibonacci sequence whose values do
# not exceed four million, find the sum of the even-valued terms.
#
#######################################################################
a = 0
b = 1
c = 0
sum = 0
while a + b <= 4000000:
c = a + b
a = b
b = c
if c % 2 is 0:
sum += c
print("{}".format(sum))
# Solution: 4613732