I solved the Euler project problem , which is as follows:
Considering the members in the Fibonacci sequence, whose values ββdo not exceed four million, we find the sum of the even members. "
So, I used this script to print the Fibonacci sequence to four million:
a = 0 b = 1 while b < 4000000: print b a, b = b, a+b
Obviously, I could run this and just manually add even values, but I would feel like I was cheating.
Technically, I assume I am asking two questions:
- How can I choose Evenki?
- How can I add these evens without assigning them to a variable?
Oh, and I'm sure this is very obvious, but I'm very new to ... well, programming in general, and I can easily get lost in the verbosity of experts. Thank you in advance!
source share