euler2 Even Fibonacci Total
<p>Jun 25, 2012 10:50 AM
 
def euler2():
   c=1
   total=2
   a=1
   b=2
   while c<4000000:
       c=a+b
       a=b
       b=c
       if c%2==0:
           total=total+c
       if c<100:
           print a,b,c,total
   print total
 
comments on euler2():    note the :  colon after the name of the function  euler2
note the indents
note the colon after the conditions in the while loop and the if statement
note the ==  double =  means the logical equal test.
note.. NO punctuation needed to terminate the function defintion nor level
of embedding.. it's all done by indentation (supplied automatically by the editor)</p>